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 사용하여 속성 값이 기본값에서 변경되었는지 여부를 확인할 수 있습니다.

적용 대상