PanelStyle Class
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