Freigeben über


DataGrid.GridLineColor-Eigenschaft

Ruft die Farbe der Datenblattlinien ab oder legt diese fest.

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

Syntax

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

value = instance.GridLineColor

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

/** @property */
public void set_GridLineColor (Color value)
public function get GridLineColor () : Color

public function set GridLineColor (value : Color)

Eigenschaftenwert

Eine Color, die die Farbe der Datenblattlinien darstellt. Der Standardwert ist die Systemfarbe für Steuerelemente (Control).

Ausnahmen

Ausnahmetyp Bedingung

ArgumentException

Der Wert ist nicht festgelegt.

Hinweise

Wenn die GridLineStyle-Eigenschaft auf DataGridLineStyle.None festgelegt ist, werden keine Datenblattlinien angezeigt.

Beispiel

Im folgenden Codebeispiel wird mithilfe eines an die Methode übergebenen Werts die Farbe der Datenblattlinien festgelegt.

Private Sub SetGridLineColor(myGrid As DataGrid, newcolor As System.Drawing.Color)
    myGrid.GridLineColor = newcolor
End Sub 'SetGridLineColor
private void SetGridLineColor
(DataGrid myGrid, System.Drawing.Color newcolor)
{
   myGrid.GridLineColor = newcolor;
}
   
private:
   void SetGridLineColor(
      DataGrid^ myGrid, System::Drawing::Color newcolor )
   {
      myGrid->GridLineColor = newcolor;
   }
private void SetGridLineColor(DataGrid myGrid, 
    System.Drawing.Color newcolor)
{
    myGrid.set_GridLineColor(newcolor);
} //SetGridLineColor

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, 1.0

Siehe auch

Referenz

DataGrid-Klasse
DataGrid-Member
System.Windows.Forms-Namespace
GridLineStyle