DataGrid.SelectionForeColor プロパティ
選択された行の前景色を取得または設定します。
Public Property SelectionForeColor As Color
[C#]
public Color SelectionForeColor {get; set;}
[C++]
public: __property Color get_SelectionForeColor();public: __property void set_SelectionForeColor(Color);
[JScript]
public function get SelectionForeColor() : Color;public function set SelectionForeColor(Color);
プロパティ値
選択された行の前景色を表す Color 。既定値は ActiveCaptionText 色です。
使用例
' 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")
[C#]
// 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");
[C++]
// String variable used to show message.
String* myString = S"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, S" to ");
myString = String::Concat(myString, myDataGrid->SelectionBackColor.ToString());
// Show information about changes in color setting.
MessageBox::Show(myString, S"Selection background color information");
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET