DataGridTableStyle.ResetSelectionForeColor メソッド
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文
通常、DataGridTableStyle のデザイナを作成する場合、または DataGridTableStyle が組み込まれている独自のコントロールを作成する場合に、このメソッドを使用します。ShouldSerializeSelectionForeColor メソッドを使用して、プロパティの値が既定値から変更されたかどうかを判断します。
' 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")
// 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. 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.get_SelectionForeColor(); myString += myCurrentColor.ToString(); // Reset selection fore color to default. customersStyle.ResetSelectionForeColor(); myString += " to "; myString += System.Convert.ToString(customersStyle.get_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.get_SelectionForeColor(); myString += myCurrentColor.ToString(); // Reset selection fore color to default. customersStyle.ResetSelectionForeColor(); myString += " to "; myString += System.Convert.ToString(customersStyle. get_SelectionForeColor()); // Show information about changes in color setting. MessageBox.Show(myString, "Selection fore color information");
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
DataGridTableStyle クラス
DataGridTableStyle メンバ
System.Windows.Forms 名前空間
SelectionBackColor
SelectionForeColor
SelectionForeColorChanged
ShouldSerializeSelectionForeColor
- DataGridTableStyle.ResetSelectionForeColor メソッドのページへのリンク