DataGrid.ResetSelectionForeColor Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Restablece el valor predeterminado de la propiedad SelectionForeColor.
public:
void ResetSelectionForeColor();
public void ResetSelectionForeColor ();
member this.ResetSelectionForeColor : unit -> unit
Public Sub ResetSelectionForeColor ()
Ejemplos
En el ejemplo de código siguiente se muestra el uso de este miembro.
// 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")
Comentarios
Normalmente, use este método si va a crear un diseñador para o System.Windows.Forms.DataGrid crear su propio control que incorpore .System.Windows.Forms.DataGrid Puede usar el ShouldSerializeSelectionForeColor método para determinar si el valor de la propiedad ha cambiado de su valor predeterminado.