次の方法で共有


IXRFrameworkElement::SetHorizontalAlignment (Compact 2013)

3/28/2014

This method sets the characteristics that determine the horizontal alignment of this framework element when it is displayed inside a parent element, such as a panel or items control.

Syntax

virtual HRESULT STDMETHODCALLTYPE SetHorizontalAlignment(
    __in XRHorizontalAlignment HorizontalAlignment
) = 0; 

Parameters

  • pHorizontalAlignment
    [in] XRHorizontalAlignment member that indicates the new horizontal alignment setting.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

When the Height and Width dependency properties are explicitly set on an element by calling IXRFrameworkElement::SetHeight or IXRFrameworkElement::SetWidth, these measurements take higher precedent during layout, and they will override the effects of setting XRHorizontalAlignment to XRHorizontalAlignment_Stretch.

IXRCanvas does not use XRHorizontalAlignment when it composes the layout because IXRCanvas is based on absolute positioning. Generally, the value of XRHorizontalAlignment is potentially treated differently by any object that can have one or more IXRFrameworkElement derived object classes as child elements.

.NET Framework Equivalent

System.Windows.FrameworkElement.HorizontalAlignment

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRFrameworkElement
IXRFrameworkElement::GetHorizontalAlignment