DataGridTableStyle.ResetBackColor メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
BackColor プロパティを既定値にリセットします。
public:
void ResetBackColor();
public void ResetBackColor ();
member this.ResetBackColor : unit -> unit
Public Sub 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.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 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
Private Sub myButton1_Click(sender As Object, e As EventArgs)
' Reset the background color.
myTableStyle.ResetBackColor()
End Sub
注釈
通常、このメソッドは、 の DataGridTableStyle デザイナーを作成する場合、または を組み込む独自のコントロールを作成する場合に使用します DataGridTableStyle。
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET