DataGridTableStyle.SelectionBackColor Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the background color of selected cells.
public:
property System::Drawing::Color SelectionBackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color SelectionBackColor { get; set; }
member this.SelectionBackColor : System.Drawing.Color with get, set
Public Property SelectionBackColor As Color
Property Value
The Color that represents the background color of selected cells.
Examples
The following code example demonstrates the use of this member.
// Allow the user to select a Color.
ColorDialog^ myColorDialog = gcnew 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;
// 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;
' 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
Applies to
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.