Share via


ToolBarTray.Orientation 属性

定义

指定 ToolBarTray 的方向。

public:
 property System::Windows::Controls::Orientation Orientation { System::Windows::Controls::Orientation get(); void set(System::Windows::Controls::Orientation value); };
public System.Windows.Controls.Orientation Orientation { get; set; }
member this.Orientation : System.Windows.Controls.Orientation with get, set
Public Property Orientation As Orientation

属性值

Orientation 值之一。 默认值为 Horizontal

示例

以下示例演示如何使用 Orientation 属性设置工具栏托盘的方向;这决定了工具栏的方向。

<ToolBarTray Orientation="Vertical" 
             Background="White" >
  <ToolBar Band="1" BandIndex="1">
    <Button>
      <Image Source="toolbargraphics\copy.bmp" />
    </Button>
    <Button>
      <Image Source="toolbargraphics\paste.bmp" />
    </Button>
  </ToolBar>
  <ToolBar Band="2" BandIndex="1">
    <Button>
      <Image Source="toolbargraphics\undo.bmp" />
    </Button>
    <Button>
      <Image Source="toolbargraphics\redo.bmp" />
    </Button>
  </ToolBar>
</ToolBarTray>

注解

依赖项属性信息

标识符字段 OrientationProperty
元数据属性设置为 true AffectsParentMeasure

适用于

另请参阅