Export (0) Print
Expand All

Panel.HorizontalAlign Property

Gets or sets the horizontal alignment of the contents within the panel.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

abstract HorizontalAlign : HorizontalAlign with get, set 
override HorizontalAlign : HorizontalAlign with get, set

Property Value

Type: System.Web.UI.WebControls.HorizontalAlign
One of the HorizontalAlign values. The default is NotSet.

ExceptionCondition
ArgumentOutOfRangeException

The horizontal alignment is not one of the HorizontalAlign values.

Use this property to specify the alignment of the elements in the Panel.

TopicLocation
How to: Add Panel Web Server Controls to a Web Forms PageBuilding ASP .NET Web Applications
How to: Add Panel Web Server Controls to a Web Forms PageBuilding ASP .NET Web Applications

The following example illustrates how to right-align or left-align the controls within the Panel.

NoteNote

The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Forms Page Code Model.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Show:
© 2015 Microsoft