Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft die Eigenschaft für die Vordergrundfarbe (i. d. R. die Textfarbe) des System.Windows.Forms.DataGrid-Steuerelements ab oder legt diese fest.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Overrides Property ForeColor As Color
'Usage
Dim instance As DataGrid
Dim value As Color
value = instance.ForeColor
instance.ForeColor = value
public override Color ForeColor { get; set; }
public:
virtual property Color ForeColor {
Color get () override;
void set (Color value) override;
}
/** @property */
public Color get_ForeColor ()
/** @property */
public void set_ForeColor (Color value)
public override function get ForeColor () : Color
public override function set ForeColor (value : Color)
Eigenschaftenwert
Eine Color, die die Vordergrundfarbe darstellt. Die Standardfarbe ist die WindowText-Farbe.
Beispiel
' String variable used to show message.
Dim myString As String = "Selection backgound color changed from: "
' Store current foreground color of selected cells.
Dim myCurrentColor As Color = myDataGrid.SelectionBackColor
myString += myCurrentColor.ToString()
' Reset selection background color to default.
myDataGrid.ResetSelectionBackColor()
myString += " to "
myString += myDataGrid.SelectionBackColor.ToString()
' Show information about changes in color setting.
MessageBox.Show(myString, "Selection background color information")
// String variable used to show message.
string myString = "Selection backgound color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = myDataGrid.SelectionBackColor;
myString += myCurrentColor.ToString();
// Reset selection background color to default.
myDataGrid.ResetSelectionBackColor();
myString += " to ";
myString += myDataGrid.SelectionBackColor.ToString();
// Show information about changes in color setting.
MessageBox.Show(myString, "Selection background color information");
// String variable used to show message.
String^ myString = "Selection backgound color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = myDataGrid->SelectionBackColor;
myString = String::Concat( myString, myCurrentColor.ToString() );
// Reset selection background color to default.
myDataGrid->ResetSelectionBackColor();
myString = String::Concat( myString, " to " );
myString = String::Concat( myString, myDataGrid->SelectionBackColor.ToString() );
// Show information about changes in color setting.
MessageBox::Show( myString, "Selection background color information" );
// String variable used to show message.
String myString = "Selection backgound color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = myDataGrid.get_SelectionBackColor();
myString += myCurrentColor.ToString();
// Reset selection background color to default.
myDataGrid.ResetSelectionBackColor();
myString += " to ";
myString += myDataGrid.get_SelectionBackColor().ToString();
// Show information about changes in color setting.
MessageBox.Show(myString, "Selection background color information");
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0
Siehe auch
Referenz
DataGrid-Klasse
DataGrid-Member
System.Windows.Forms-Namespace