共用方式為


ProgressBar.Orientation 屬性

定義

取得或設定一個 ProgressBar方向:水平或垂直。

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

範例

以下建立 的 ProgressBar 範例展示了如何利用該 Orientation 屬性來製作水平條。

ProgressBar progbar = new ProgressBar();
progbar.IsIndeterminate = false;
progbar.Orientation = Orientation.Horizontal;
progbar.Width = 150;
progbar.Height = 15;
Duration duration = new Duration(TimeSpan.FromSeconds(10));
DoubleAnimation doubleanimation = new DoubleAnimation(100.0, duration);
progbar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);
Dim progbar As New ProgressBar()
progbar.IsIndeterminate = False
progbar.Orientation = Orientation.Horizontal
progbar.Width = 150
progbar.Height = 15
Dim duration As New Duration(TimeSpan.FromSeconds(10))
Dim doubleanimation As New DoubleAnimation(100.0, duration)
progbar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation)

備註

相依財產資訊

項目 價值
識別碼欄位 OrientationProperty
元資料屬性設為 true AffectsMeasure

適用於