|
Cet article a fait l'objet d'une traduction manuelle. Déplacez votre pointeur sur les phrases de l'article pour voir la version originale de ce texte.
|
Traduction
Source
|
Control.Foreground, propriété
.NET Framework 4
Assembly : PresentationFramework (dans PresentationFramework.dll)
Valeur de propriété
Type : System.Windows.Media.Brush<Button Name="btn1" Foreground="Black" Click="ChangeForeground"> Foreground </Button>
Private Sub ChangeForeground(ByVal Sender As Object, ByVal e As RoutedEventArgs) If (Equals(btn1.Foreground, Brushes.Green)) Then btn1.Foreground = Brushes.Black btn1.Content = "Foreground" Else btn1.Foreground = Brushes.Green btn1.Content = "Control foreground(text) changes from black to green." End If End Sub
void ChangeForeground(object sender, RoutedEventArgs e) { if (btn1.Foreground == Brushes.Green) { btn1.Foreground = Brushes.Black; btn1.Content = "Foreground"; } else { btn1.Foreground = Brushes.Green; btn1.Content = "Control foreground(text) changes from black to green."; } }
Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2
Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.