次の方法で共有


DataGridTableStyle.SelectionBackColor プロパティ

選択されているセルの背景色を取得または設定します。

Public Property SelectionBackColor As Color
[C#]
public Color SelectionBackColor {get; set;}
[C++]
public: __property Color get_SelectionBackColor();public: __property void set_SelectionBackColor(Color);
[JScript]
public function get SelectionBackColor() : Color;public function set SelectionBackColor(Color);

プロパティ値

選択されているセルの背景色を表す Color

使用例

 
' Allow the user to select a Color.
Dim myColorDialog As New ColorDialog()
myColorDialog.AllowFullOpen = False
myColorDialog.ShowHelp = True
' Set the initial color select to the current color.
myColorDialog.Color = myGridTableStyle.SelectionBackColor
' Show color dialog box.
myColorDialog.ShowDialog()
' Set the backcolor for the selected cells. 
myGridTableStyle.SelectionBackColor = myColorDialog.Color

[C#] 
// Allow the user to select a Color.
ColorDialog myColorDialog = new ColorDialog();      
myColorDialog.AllowFullOpen = false ;      
myColorDialog.ShowHelp = true ;
// Set the initial color select to the current color.
myColorDialog.Color = myGridTableStyle.SelectionBackColor;
// Show color dialog box.
myColorDialog.ShowDialog();
// Set the backcolor for the selected cells. 
myGridTableStyle.SelectionBackColor = myColorDialog.Color;    

[C++] 
// Allow the user to select a Color.
ColorDialog* myColorDialog = new ColorDialog();
myColorDialog->AllowFullOpen = false ;
myColorDialog->ShowHelp = true ;
// Set the initial color select to the current color.
myColorDialog->Color = myGridTableStyle->SelectionBackColor;
// Show color dialog box.
myColorDialog->ShowDialog();
// Set the backcolor for the selected cells.
myGridTableStyle->SelectionBackColor = myColorDialog->Color;

[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 ファミリ

参照

DataGridTableStyle クラス | DataGridTableStyle メンバ | System.Windows.Forms 名前空間 | ResetSelectionBackColor | SelectionBackColorChanged | ShouldSerializeSelectionBackColor | SelectionForeColor