DataGrid.ResetGridLineColor Methode

Definition

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

public:
 void ResetGridLineColor();
public void ResetGridLineColor ();
member this.ResetGridLineColor : unit -> unit
Public Sub ResetGridLineColor ()

Beispiele

Im folgenden Codebeispiel wird die Verwendung dieses Members veranschaulicht.

// 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.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.
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")

Hinweise

In der Regel verwenden Sie diese Methode, wenn Sie entweder einen Designer für oder ein eigenes System.Windows.Forms.DataGrid Steuerelement erstellen, das das System.Windows.Forms.DataGrid-Steuerelement enthält. Sie können die ShouldSerializeGridLineColor -Methode verwenden, um zu bestimmen, ob sich der Eigenschaftswert gegenüber dem Standardwert geändert hat.

Gilt für: