Expand Minimize

Control.HorizontalContentAlignment property

Applies to Windows and Windows Phone

Gets or sets the horizontal alignment of the control's content.

Syntax


public:
property HorizontalAlignment HorizontalContentAlignment { 
   HorizontalAlignment get();
   void set (HorizontalAlignment value);
}


<control HorizontalContentAlignment="horizontalAlignmentMemberName"/>

XAML Values

horizontalAlignmentMemberName

A named constant of the HorizontalAlignment enumeration, such as Stretch.

Property value

Type: HorizontalAlignment

One of the HorizontalAlignment values. The default is Left.

Remarks

Each control might apply this property differently based on the Style setters for the control's implicit style, and its visual template. Also, the apparent "default value" of each individual control used in UI can be different. For example, a Button control starts with the value Center.

A value for the HorizontalContentAlignment property only affects layout behavior for a control when its template uses the HorizontalContentAlignment property as the source of a HorizontalAlignment value for presenters or content areas within. On other controls, setting HorizontalContentAlignment has no effect. For more info about visual templates for controls, see the reference for Control.Template.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

Control
VerticalContentAlignment
FrameworkElement.HorizontalAlignment
Alignment, margin, and padding for UI element layout

 

 

Show:
© 2014 Microsoft