Panel.Background Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
public:
property System::Windows::Media::Brush ^ Background { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush Background { get; set; }
member this.Background : System.Windows.Media.Brush with get, set
Public Property Background As Brush
Valeur de propriété
Brush Cette valeur par défaut est null
.
Exemples
L’exemple suivant définit le Background d’un Grid sur un RadialGradientBrush.
<Grid>
<Grid.Background>
<RadialGradientBrush
GradientOrigin="0.5,0.5"
Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
<RadialGradientBrush.GradientStops>
<GradientStop Color="Yellow" Offset="0" />
<GradientStop Color="Red" Offset="0.25" />
<GradientStop Color="Blue" Offset="0.75" />
<GradientStop Color="Green" Offset="1" />
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
</Grid.Background>
</Grid>
Remarques
Panel les éléments ne reçoivent pas d’événements de souris ou de stylet si un Background n’est pas défini. Si vous devez gérer des événements de souris ou de stylet, mais que vous ne souhaitez pas d’arrière-plan pour votre Panel, utilisez Transparent.
Informations sur les propriétés de dépendance
Champ Identificateur | BackgroundProperty |
Propriétés de métadonnées définies sur true |
AffectsRender, SubPropertiesDoNotAffectRender |
S’applique à
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour