Share via


ToolBar.Orientation 属性

定义

获取 ToolBar 的方向。

public:
 property System::Windows::Controls::Orientation Orientation { System::Windows::Controls::Orientation get(); };
public System.Windows.Controls.Orientation Orientation { get; }
member this.Orientation : System.Windows.Controls.Orientation
Public ReadOnly Property Orientation As Orientation

属性值

工具栏的方向。 默认值为 Horizontal

示例

以下示例演示如何确定 是否 ToolBar 为垂直。

if (tb1.Orientation == Orientation.Vertical)
{
    btnText.Content = "This is a vertical toolbar.";
}
If tb1.Orientation = Orientation.Vertical Then
    btnText.Content = "This is a vertical toolbar."
End If

注解

此属性从父 ToolBarTray获取其值。

依赖项属性信息

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

适用于

另请参阅