Freigeben über


DataGrid.BackgroundColor-Eigenschaft

Ruft die Farbe des Bereichs unter den Zeilen des Datenblatts ab oder legt diese fest.

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

Syntax

'Declaration
Public Property BackgroundColor As Color
'Usage
Dim instance As DataGrid
Dim value As Color

value = instance.BackgroundColor

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

/** @property */
public void set_BackgroundColor (Color value)
public function get BackgroundColor () : Color

public function set BackgroundColor (value : Color)

Eigenschaftenwert

Eine Color, die die Farbe des Hintergrunds des Datenblatts darstellt. Die Standardfarbe ist die AppWorkspace-Farbe.

Hinweise

Die BackgroundColor bestimmt die Farbe des Bereichs unterhalb der Datenblattzeilen, der nur angezeigt wird, wenn im System.Windows.Forms.DataGrid keine Tabelle angezeigt wird, ein Bildlauf an das Ende des Datenblatts durchgeführt wird oder das Datenblatt nur wenige Zeilen enthält.

Beispiel

Im folgenden Codebeispiel werden die BackColor-Eigenschaft und die BackgroundColor-Eigenschaft festgelegt.

Private Sub SetGridColors()
    dataGrid1.BackColor = System.Drawing.Color.Red
    dataGrid1.AlternatingBackColor = System.Drawing.Color.AliceBlue
    dataGrid1.BackgroundColor = System.Drawing.Color.Yellow
End Sub 'SetGridColors
private void SetGridColors(){
    dataGrid1.BackColor=System.Drawing.Color.Red;
    dataGrid1.AlternatingBackColor= System.Drawing.Color.AliceBlue;
    dataGrid1.BackgroundColor=System.Drawing.Color.Yellow;
 }
 
private:
   void SetGridColors()
   {
      dataGrid1->BackColor = System::Drawing::Color::Red;
      dataGrid1->AlternatingBackColor = System::Drawing::Color::AliceBlue;
      dataGrid1->BackgroundColor = System::Drawing::Color::Yellow;
   }
private void SetGridColors()
{
    dataGrid1.set_BackColor(System.Drawing.Color.get_Red());
    dataGrid1.set_AlternatingBackColor(
        System.Drawing.Color.get_AliceBlue());
    dataGrid1.set_BackgroundColor(System.Drawing.Color.get_Yellow());
} //SetGridColors

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

.NET Compact Framework

Unterstützt in: 2.0

Siehe auch

Referenz

DataGrid-Klasse
DataGrid-Member
System.Windows.Forms-Namespace
DataGrid.BackColor-Eigenschaft