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

屬性值

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

適用於

另請參閱