Freigeben über


DataGridTableStyle.ResetForeColor-Methode

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

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

Syntax

'Declaration
Public Sub ResetForeColor
'Usage
Dim instance As DataGridTableStyle

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

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 ShouldSerializeForeColor-Methode bestimmen, ob der Eigenschaftenwert geändert wurde und nicht mehr dem Standardwert entspricht.

Beispiel

Private Sub BtnSetForeColor_Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Set the foreground color of table.
    myDataGridTableStyle.ForeColor = Color.Blue
    myDataGrid.TableStyles.Add(myDataGridTableStyle)
End Sub 'BtnSetForeColor_Click
      
Private Sub BtnResetForeColor_Click(ByVal sender As Object, ByVal e As EventArgs)
    ' Reset the foreground color of table to its default value.
    myDataGridTableStyle.ResetForeColor()
End Sub 'BtnResetForeColor_Click
 private void BtnSetForeColor_Click(Object sender, EventArgs e)
 {
    // Set the foreground color of table.
    myDataGridTableStyle.ForeColor=Color.Blue;
    myDataGrid.TableStyles.Add(myDataGridTableStyle);
 }
private void BtnResetForeColor_Click(Object sender, EventArgs e)
{
   // Reset the foreground color of table to its default value.
   myDataGridTableStyle.ResetForeColor();
}
private:
   void BtnSetForeColor_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Set the foreground color of table.
      myDataGridTableStyle->ForeColor = Color::Blue;
      myDataGrid->TableStyles->Add( myDataGridTableStyle );
   }

   void BtnResetForeColor_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Reset the foreground color of table to its default value.
      myDataGridTableStyle->ResetForeColor();
   }
void BtnSetForeColor_Click(Object sender, EventArgs e)
{
    // Set the foreground color of table.
    myDataGridTableStyle.set_ForeColor(Color.get_Blue());
    myDataGrid.get_TableStyles().Add(myDataGridTableStyle);
} //BtnSetForeColor_Click

void BtnResetForeColor_Click(Object sender, EventArgs e)
{
    // Reset the foreground color of table to its default value.
    myDataGridTableStyle.ResetForeColor();
} //BtnResetForeColor_Click

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