PanelStyle.HorizontalAlign Property

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

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

public:
virtual property HorizontalAlign HorizontalAlign {
	HorizontalAlign get ();
	void set (HorizontalAlign value);
}
/** @property */
public HorizontalAlign get_HorizontalAlign ()

/** @property */
public void set_HorizontalAlign (HorizontalAlign value)

public function get HorizontalAlign () : HorizontalAlign

public function set HorizontalAlign (value : HorizontalAlign)

Not applicable.

Property Value

One of the HorizontalAlign values. The default is NotSet.

Exception typeCondition

ArgumentOutOfRangeException

The horizontal alignment is not one of the HorizontalAlign values.

The HorizontalAlign property specifies the horizontal alignment of the contents within a panel control.

The HorizontalAlign property is set using one of the HorizontalAlign enumeration values. The following table lists the possible values.

Value

Description

NotSet

The horizontal alignment is not set.

Left

The contents of the panel are left-aligned.

Center

The contents of the panel are centered.

Right

The contents of the panel are right-aligned.

NoteNote:

. If the HorizontalAlign property is set to NotSet but the property is set in the control that contains the panel control, the setting is inherited from the containing control.

The following code example sets the HorizontalAlign properties of two panel controls, Panel1 and Panel2, to the HorizontalAlign.Center enumeration value. For an .aspx file that can be used to run the example, see the PanelStyle topic.

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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: