DataGridTableStyle.ResetForeColor メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ForeColor プロパティを既定値にリセットします。
public:
void ResetForeColor();
public void ResetForeColor ();
member this.ResetForeColor : unit -> unit
Public Sub ResetForeColor ()
例
次のコード例では、このメンバーの使用方法を示します。
private:
void BtnSetForeColor_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Set the foreground color of table.
myDataGridTableStyle->ForeColor = Color::Blue;
myDataGrid->TableStyles->Add( myDataGridTableStyle );
}
void BtnResetForeColor_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
// Reset the foreground color of table to its default value.
myDataGridTableStyle->ResetForeColor();
}
private void BtnSetForeColor_Click(Object sender, EventArgs e)
{
// Set the foreground color of table.
myDataGridTableStyle.ForeColor=Color.Blue;
myDataGrid.TableStyles.Add(myDataGridTableStyle);
}
private void BtnResetForeColor_Click(Object sender, EventArgs e)
{
// Reset the foreground color of table to its default value.
myDataGridTableStyle.ResetForeColor();
}
Private Sub BtnSetForeColor_Click(ByVal sender As Object, ByVal e As EventArgs)
' Set the foreground color of table.
myDataGridTableStyle.ForeColor = Color.Blue
myDataGrid.TableStyles.Add(myDataGridTableStyle)
End Sub
Private Sub BtnResetForeColor_Click(ByVal sender As Object, ByVal e As EventArgs)
' Reset the foreground color of table to its default value.
myDataGridTableStyle.ResetForeColor()
End Sub
注釈
通常、このメソッドは、 の DataGridTableStyle デザイナーを作成する場合、または を組み込む独自のコントロールを作成する場合に使用します DataGridTableStyle。 メソッドを ShouldSerializeForeColor 使用して、プロパティ値が既定値から変更されたかどうかを判断できます。
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET