DataGridTableStyle.ResetForeColor メソッド

定義

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 使用して、プロパティ値が既定値から変更されたかどうかを判断できます。

適用対象