DataGridTableStyle.ResetHeaderFont Methode

Definition

Setzt die HeaderFont-Eigenschaft auf den Standardwert zurück.

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

Beispiele

Im folgenden Codebeispiel wird die Verwendung dieses Members veranschaulicht.

private:
   void MySetButton_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Set the 'HeaderFont' property of the DataGridTableStyle instance.
      myTableStyle->HeaderFont = gcnew System::Drawing::Font( "Impact",10 );

      // Add the DataGridTableStyle instance to the GridTableStylesCollection.
      myDataGrid->TableStyles->Add( myTableStyle );
   }

   void MyResetButton_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // Reset the Header Font to its default value.
      myTableStyle->ResetHeaderFont();
   }
private void MySetButton_Click(object sender, EventArgs e)
{
   // Set the 'HeaderFont' property of the DataGridTableStyle instance.
   myTableStyle.HeaderFont=new Font("Impact",10);
   // Add the DataGridTableStyle instance to the GridTableStylesCollection. 
   myDataGrid.TableStyles.Add(myTableStyle);
}
private void MyResetButton_Click(object sender, EventArgs e)
{
   // Reset the Header Font to its default value.
   myTableStyle.ResetHeaderFont();
}
 Private Sub MySetButton_Click(ByVal sender As Object, ByVal e As EventArgs)
     ' Set the 'HeaderFont' property of DataGridTableStyle instance.
     myTableStyle.HeaderFont = New Font("Impact", 10)
     ' Add the DataGridTableStyle instance to the GridTableStylesCollection. 
     myDataGrid.TableStyles.Add(myTableStyle)
 End Sub

 Private Sub MyResetButton_Click(ByVal sender As Object, ByVal e As EventArgs)
     ' Reset the Header Font to its default value.
     myTableStyle.ResetHeaderFont()
 End Sub

Hinweise

In der Regel verwenden Sie diese Methode, wenn Sie entweder einen Designer für die DataGridTableStyle erstellen oder ein eigenes Steuerelement erstellen, das das DataGridTableStyleenthält.

Gilt für:

Weitere Informationen