DataGridTableStyle.ResetSelectionForeColor Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Resetuje właściwość do wartości domyślnej SelectionForeColor .
public:
void ResetSelectionForeColor();
public void ResetSelectionForeColor ();
member this.ResetSelectionForeColor : unit -> unit
Public Sub ResetSelectionForeColor ()
Przykłady
Poniższy przykład kodu przedstawia użycie tego elementu członkowskiego.
// String variable used to show message.
String^ myString = "Fore color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = customersStyle->SelectionForeColor;
myString = String::Concat( myString, myCurrentColor );
// Reset selection fore color to default.
customersStyle->ResetSelectionForeColor();
myString = String::Concat( myString, " to " );
myString = String::Concat( myString, customersStyle->SelectionForeColor );
// Show information about changes in color setting.
MessageBox::Show( myString, "Selection fore color information" );
// String variable used to show message.
string myString = "Fore color changed from: ";
// Store current foreground color of selected cells.
Color myCurrentColor = customersStyle.SelectionForeColor;
myString += myCurrentColor.ToString();
// Reset selection fore color to default.
customersStyle.ResetSelectionForeColor();
myString += " to ";
myString += customersStyle.SelectionForeColor.ToString();
// Show information about changes in color setting.
MessageBox.Show(myString, "Selection fore color information");
' String variable used to show message.
Dim myString As String = "Fore color changed from: "
' Store current foreground color of selected cells.
Dim myCurrentColor As Color = customersStyle.SelectionForeColor
myString += myCurrentColor.ToString()
' Reset selection fore color to default.
customersStyle.ResetSelectionForeColor()
myString += " to "
myString += customersStyle.SelectionForeColor.ToString()
' Show information about changes in color setting.
MessageBox.Show(myString, "Selection fore color information")
Uwagi
Zazwyczaj używasz tej metody, jeśli tworzysz projektanta dla DataGridTableStyle obiektu lub tworzysz własną kontrolkę zawierającą DataGridTableStyleelement . Możesz użyć ShouldSerializeSelectionForeColor metody , aby określić, czy wartość właściwości została zmieniona z wartości domyślnej.
Dotyczy
Zobacz też
Opinia
https://aka.ms/ContentUserFeedback.
Dostępne już wkrótce: W 2024 r. będziemy stopniowo wycofywać zgłoszenia z serwisu GitHub jako mechanizm przesyłania opinii na temat zawartości i zastępować go nowym systemem opinii. Aby uzyskać więcej informacji, sprawdź:Prześlij i wyświetl opinię dla