DataGrid.ResetHeaderForeColor-Methode

Setzt die HeaderForeColor-Eigenschaft auf ihren Standardwert zurück.

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

Syntax

'Declaration
Public Sub ResetHeaderForeColor
'Usage
Dim instance As DataGrid

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

Hinweise

Diese Methode wird i. d. R. zum Erstellen eines Designers für das System.Windows.Forms.DataGrid oder eines eigenen Steuerelements verwendet, das das System.Windows.Forms.DataGrid aufnimmt. Mithilfe der ShouldSerializeHeaderForeColor-Methode können Sie bestimmen, ob der Wert der Eigenschaft vom Standardwert geändert wurde.

Beispiel

Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button3.Click
    Dim myColorDialog As New ColorDialog()
    ' Disable selecting a custom color.
    myColorDialog.AllowFullOpen = False
    ' Enable the help button.
    myColorDialog.ShowHelp = True
    ' Set the initial color to the current color.
    myColorDialog.Color = myDataGrid.HeaderForeColor
    ' Show color dialog box.
    myColorDialog.ShowDialog()
    ' Set the header foreground color.
    myDataGrid.HeaderForeColor = myColorDialog.Color
End Sub 'button3_Click

' Reset the header foregroundcolor.
Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button4.Click
    myDataGrid.ResetHeaderForeColor()
End Sub 'button4_Click
private void button3_Click(object sender, EventArgs e)
{
   ColorDialog myColorDialog = new ColorDialog();
   // Disable selecting a custom color.
   myColorDialog.AllowFullOpen = false ;
   // Enable the help button.
   myColorDialog.ShowHelp = true ;
   // Set the initial color to the current color.
   myColorDialog.Color = myDataGrid.HeaderForeColor;
   // Show color dialog box.
   myColorDialog.ShowDialog();
   // Set the header foreground color.
   myDataGrid.HeaderForeColor = myColorDialog.Color;
}
// Reset the header foregroundcolor.
private void button4_Click(object sender, EventArgs e)
{
   myDataGrid.ResetHeaderForeColor();
}
private:
   void button3_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      ColorDialog^ myColorDialog = gcnew ColorDialog;

      // Disable selecting a custom color.
      myColorDialog->AllowFullOpen = false;

      // Enable the help button.
      myColorDialog->ShowHelp = true;

      // Set the initial color to the current color.
      myColorDialog->Color = myDataGrid->HeaderForeColor;

      // Show color dialog box.
      myColorDialog->ShowDialog();

      // Set the header foreground color.
      myDataGrid->HeaderForeColor = myColorDialog->Color;
   }

   // Reset the header foregroundcolor.
   void button4_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      myDataGrid->ResetHeaderForeColor();
   }
private void button3_Click(Object sender, EventArgs e)
{
    ColorDialog myColorDialog = new ColorDialog();
   
    // Disable selecting a custom color.
    myColorDialog.set_AllowFullOpen(false);
    
    // Enable the help button.
    myColorDialog.set_ShowHelp(true);
    
    // Set the initial color to the current color.
    myColorDialog.set_Color(myDataGrid.get_HeaderForeColor());
    
    // Show color dialog box.
    myColorDialog.ShowDialog();
    
    // Set the header foreground color.
    myDataGrid.set_HeaderForeColor(myColorDialog.get_Color());
} //button3_Click

// Reset the header foregroundcolor.
private void button4_Click(Object sender, EventArgs e)
{
    myDataGrid.ResetHeaderForeColor();
} //button4_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

DataGrid-Klasse
DataGrid-Member
System.Windows.Forms-Namespace