Freigeben über


DataGridTableStyle.SelectionBackColor-Eigenschaft

Ruft die Hintergrundfarbe für ausgewählte Zellen ab oder legt diese fest.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
Public Property SelectionBackColor As Color
'Usage
Dim instance As DataGridTableStyle
Dim value As Color

value = instance.SelectionBackColor

instance.SelectionBackColor = value
public Color SelectionBackColor { get; set; }
public:
property Color SelectionBackColor {
    Color get ();
    void set (Color value);
}
/** @property */
public Color get_SelectionBackColor ()

/** @property */
public void set_SelectionBackColor (Color value)
public function get SelectionBackColor () : Color

public function set SelectionBackColor (value : Color)

Eigenschaftenwert

Eine Color, die die Hintergrundfarbe für ausgewählte Zellen darstellt.

Beispiel

' 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
// 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.
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.set_AllowFullOpen(false);
myColorDialog.set_ShowHelp(true);

// Set the initial color select to the current color.
myColorDialog.set_Color(myGridTableStyle.get_SelectionBackColor());

// Show color dialog box.
myColorDialog.ShowDialog();

// Set the backcolor for the selected cells. 
myGridTableStyle.set_SelectionBackColor(myColorDialog.get_Color());
// Allow the user to select a Color.
ColorDialog myColorDialog = new ColorDialog();

myColorDialog.set_AllowFullOpen(false);
myColorDialog.set_ShowHelp(true);

// Set the initial color select to the current color.
myColorDialog.set_Color(myGridTableStyle.get_SelectionBackColor());

// Show color dialog box.
myColorDialog.ShowDialog();

// Set the backcolor for the selected cells. 
myGridTableStyle.set_SelectionBackColor(myColorDialog.get_Color());

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

DataGridTableStyle-Klasse
DataGridTableStyle-Member
System.Windows.Forms-Namespace
ResetSelectionBackColor
SelectionBackColorChanged
ShouldSerializeSelectionBackColor
SelectionForeColor