ProgressBar.Orientation 屬性

定義

取得或設定 ProgressBar 的方向:水平或垂直。Gets or sets the orientation of a ProgressBar: horizontal or vertical.

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

其中一個 Orientation 值。One of the Orientation values. 預設值為 HorizontalThe default is Horizontal.

範例

下列範例會建立, ProgressBar 說明如何使用 Orientation 屬性來建立水準橫條。The following example which creates a ProgressBar shows how to use the Orientation property to make a horizontal bar.

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)

備註

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field OrientationProperty
中繼資料屬性設定為 trueMetadata properties set to true AffectsMeasure

適用於