Partager via


ProgressBar.Orientation Propriété

Définition

Obtient ou définit l’orientation d’un ProgressBar: horizontal ou 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

Valeur de propriété

Une des Orientation valeurs. La valeur par défaut est Horizontal.

Exemples

L’exemple suivant qui crée un ProgressBar montre comment utiliser la Orientation propriété pour créer une barre horizontale.

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)

Remarques

Informations sur les propriétés de dépendance

Élément Valeur
Champ d’identificateur OrientationProperty
Propriétés de métadonnées définies sur true AffectsMeasure

S’applique à