Freigeben über


DataGridTableStyle.ResetSelectionForeColor-Methode

Setzt die SelectionForeColor-Eigenschaft auf den Standardwert zurück.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Public Sub ResetSelectionForeColor
'Usage
Dim instance As DataGridTableStyle

instance.ResetSelectionForeColor
public void ResetSelectionForeColor ()
public:
void ResetSelectionForeColor ()
public void ResetSelectionForeColor ()
public function ResetSelectionForeColor ()

Hinweise

Diese Methode wird i. d. R. verwendet, um einen Designer für DataGridTableStyle bzw. ein eigenes Steuerelement zu erstellen, das DataGridTableStyle aufnimmt. Sie können mit der ShouldSerializeSelectionForeColor-Methode bestimmen, ob der Eigenschaftenwert geändert wurde und nicht mehr dem Standardwert entspricht.

Beispiel

' String variable used to show message.   
Dim myString As String = "Fore color changed from: "
' Store current foreground color of selected cells.
Dim myCurrentColor As Color = customersStyle.SelectionForeColor
myString += myCurrentColor.ToString()
' Reset selection fore color to default.
customersStyle.ResetSelectionForeColor()
myString += "  to "
myString += customersStyle.SelectionForeColor.ToString()
' Show information about changes in color setting.  
MessageBox.Show(myString, "Selection fore color information")
// String variable used to show message.   
string myString = "Fore color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = customersStyle.SelectionForeColor;
myString += myCurrentColor.ToString();
// Reset selection fore color to default.
customersStyle.ResetSelectionForeColor();
myString += "  to ";
myString += customersStyle.SelectionForeColor.ToString();
// Show information about changes in color setting.  
MessageBox.Show(myString, "Selection fore color information");
// String variable used to show message.
String^ myString = "Fore color changed from: ";

// Store current foreground color of selected cells.
Color myCurrentColor = customersStyle->SelectionForeColor;
myString = String::Concat( myString, myCurrentColor );

// Reset selection fore color to default.
customersStyle->ResetSelectionForeColor();
myString = String::Concat( myString, "  to " );
myString = String::Concat( myString, customersStyle->SelectionForeColor );

// Show information about changes in color setting.
MessageBox::Show( myString, "Selection fore color information" );
// String variable used to show message.   
String myString = "Fore color changed from: ";

// Store current foreground color of selected cells.
Color myCurrentColor = customersStyle.get_SelectionForeColor();

myString += myCurrentColor.ToString();

// Reset selection fore color to default.
customersStyle.ResetSelectionForeColor();
myString += "  to ";
myString += System.Convert.ToString(customersStyle.get_SelectionForeColor());

// Show information about changes in color setting.  
MessageBox.Show(myString, "Selection fore color information");
// String variable used to show message.   
String myString = "Fore color changed from: ";

// Store current foreground color of selected cells.
Color myCurrentColor = customersStyle.get_SelectionForeColor();

myString += myCurrentColor.ToString();

// Reset selection fore color to default.
customersStyle.ResetSelectionForeColor();
myString += "  to ";
myString += System.Convert.ToString(customersStyle.
    get_SelectionForeColor());

// Show information about changes in color setting.  
MessageBox.Show(myString, "Selection fore 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

Siehe auch

Referenz

DataGridTableStyle-Klasse
DataGridTableStyle-Member
System.Windows.Forms-Namespace
SelectionBackColor
SelectionForeColor
SelectionForeColorChanged
ShouldSerializeSelectionForeColor