DataGrid.ResetHeaderFont Metoda

Definicja

Resetuje właściwość do wartości domyślnej HeaderFont .

public:
 void ResetHeaderFont();
public void ResetHeaderFont ();
member this.ResetHeaderFont : unit -> unit
Public Sub ResetHeaderFont ()

Przykłady

Poniższy przykład kodu przedstawia użycie tego elementu członkowskiego.

private:
   // Set the header font to Arial with size 20.
   void button6_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      myDataGrid->HeaderFont = gcnew System::Drawing::Font( "Arial",20 );
   }

   // Reset the header font.
   void button5_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      myDataGrid->ResetHeaderFont();
   }
// Set the header font to Arial with size 20.
private void button6_Click(object sender, EventArgs e)
{
   myDataGrid.HeaderFont = new Font("Arial", 20);
}
// Reset the header font.
private void button5_Click(object sender, EventArgs e)
{
   myDataGrid.ResetHeaderFont();
}
' Set the header font to Arial with size 20.
Private Sub button6_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button6.Click
    myDataGrid.HeaderFont = New Font("Arial", 20)
End Sub

' Reset the header font.
Private Sub button5_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button5.Click
    myDataGrid.ResetHeaderFont()
End Sub

Uwagi

Zazwyczaj używasz tej metody, jeśli tworzysz projektanta dla System.Windows.Forms.DataGrid obiektu lub tworzysz własną kontrolkę zawierającą System.Windows.Forms.DataGridelement . Możesz użyć ShouldSerializeHeaderFont metody , aby określić, czy wartość właściwości została zmieniona z wartości domyślnej.

Dotyczy