Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Setzt die BackColor-Eigenschaft auf den Standardwert zurück.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Sub ResetBackColor
'Usage
Dim instance As DataGridTableStyle
instance.ResetBackColor
public void ResetBackColor ()
public:
void ResetBackColor ()
public void ResetBackColor ()
public function ResetBackColor ()
Hinweise
Diese Methode wird i. d. R. verwendet, um einen Designer für DataGridTableStyle bzw. ein eigenes Steuerelement zu erstellen, das DataGridTableStyle aufnimmt.
Beispiel
Private Sub AddCustomColumnStyle()
' Set the TableStyle Mapping name.
myTableStyle.MappingName = "customerTable"
myTableStyle.BackColor = Color.Pink
' Set the ColumnStyle properties and add to TableStyle.
myColumnStyle.MappingName = "Customers"
myColumnStyle.HeaderText = "Customer Name"
myColumnStyle.Width = 250
myTableStyle.GridColumnStyles.Add(myColumnStyle)
myDataGrid.TableStyles.Add(myTableStyle)
End Sub 'AddCustomColumnStyle
Private Sub myButton1_Click(sender As Object, e As EventArgs)
' Reset the background color.
myTableStyle.ResetBackColor()
End Sub 'myButton1_Click
private void AddCustomColumnStyle()
{
// Set the TableStyle Mapping name.
myTableStyle.MappingName = "customerTable";
myTableStyle.BackColor = Color.Pink;
// Set the ColumnStyle properties and add to TableStyle.
myColumnStyle.MappingName = "Customers";
myColumnStyle.HeaderText = "Customer Name";
myColumnStyle.Width = 250;
myTableStyle.GridColumnStyles.Add(myColumnStyle);
myDataGrid.TableStyles.Add(myTableStyle);
}
private void myButton1_Click(object sender, EventArgs e)
{
// Reset the background color.
myTableStyle.ResetBackColor();
}
private:
void AddCustomColumnStyle()
{
// Set the TableStyle Mapping name.
myTableStyle->MappingName = "customerTable";
myTableStyle->BackColor = Color::Pink;
// Set the ColumnStyle properties and add to TableStyle.
myColumnStyle->MappingName = "Customers";
myColumnStyle->HeaderText = "Customer Name";
myColumnStyle->Width = 250;
myTableStyle->GridColumnStyles->Add( myColumnStyle );
myDataGrid->TableStyles->Add( myTableStyle );
}
void myButton1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Reset the background color.
myTableStyle->ResetBackColor();
}
private void AddCustomColumnStyle()
{
// Set the TableStyle Mapping name.
myTableStyle.set_MappingName("customerTable");
myTableStyle.set_BackColor(Color.get_Pink());
// Set the ColumnStyle properties and add to TableStyle.
myColumnStyle.set_MappingName("Customers");
myColumnStyle.set_HeaderText("Customer Name");
myColumnStyle.set_Width(250);
myTableStyle.get_GridColumnStyles().Add(myColumnStyle);
myDataGrid.get_TableStyles().Add(myTableStyle);
} //AddCustomColumnStyle
private void myButton1_Click(Object sender, EventArgs e)
{
// Reset the background color.
myTableStyle.ResetBackColor();
} //myButton1_Click
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