PanelStyle Class
Represents the style for a Panel control.
Assembly: System.Web (in System.Web.dll)
The PanelStyle class is used to represent the style settings for a panel control. It encapsulates the properties that control the appearance of a panel and can be applied to multiple panel controls to provide a common appearance.
You can specify an image to display in the background of the panel by setting the BackImageUrl property. The horizontal alignment of the contents of the panel is indicated by the HorizontalAlign property. The direction of controls that contain text within the panel control can be specified by setting the Direction property.
The following code example demonstrates creating a PanelStyle object and setting its properties. This example has two parts:
A partial class, PanelStylecs_aspx, that demonstrates creating a new PanelStyle object and setting its properties.
A Web Forms page that uses the PanelStylecs_aspx example as its code-behind file.
The first part of the example demonstrates creating a PanelStyle object, myPanelStyle, and setting its properties. Then the ApplyStyle method is called for both the Panel1 panel and the Panel2 panel, and myPanelStyle is applied to both of them.
The second part of the example shows an .aspx file that is used with the previous example.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System::MarshalByRefObject
System.ComponentModel::Component
System.Web.UI.WebControls::Style
System.Web.UI.WebControls::PanelStyle
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.