This documentation is archived and is not being maintained.

DataGridTableStyle.ResetForeColor Method

Resets the ForeColor property to its default value.

[Visual Basic]
Public Sub ResetForeColor()
[C#]
public void ResetForeColor();
[C++]
public: void ResetForeColor();
[JScript]
public function ResetForeColor();

Remarks

You typically use this method if you are either creating a designer for the DataGridTableStyle or creating your own control incorporating the DataGridTableStyle. You can use the ShouldSerializeForeColor method to determine whether the property value has changed from its default.

Example

[Visual Basic] 
Sub BtnSetForeColor_Click(sender As Object, e As EventArgs)
   ' Set the foreground color of table.
   myDataGridTableStyle.ForeColor = Color.Blue
   myDataGrid.TableStyles.Add(myDataGridTableStyle)
End Sub 'BtnSetForeColor_Click

Sub BtnResetForeColor_Click(sender As Object, e As EventArgs)
   ' Reset the foreground color of table to its default value.
   myDataGridTableStyle.ResetForeColor()
End Sub 'BtnResetForeColor_Click

[C#] 
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();
           }

[C++] 
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();
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DataGridTableStyle Class | DataGridTableStyle Members | System.Windows.Forms Namespace

Show: