This documentation is archived and is not being maintained.

DataGridTableStyle.SelectionBackColor Property

Gets or sets the background color of selected cells.

[Visual Basic]
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);

Property Value

The Color that represents the background color of selected cells.

Example

[Visual Basic] 
' 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] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DataGridTableStyle Class | DataGridTableStyle Members | System.Windows.Forms Namespace | ResetSelectionBackColor | SelectionBackColorChanged | ShouldSerializeSelectionBackColor | SelectionForeColor

Show: