Muokkaa

Jaa


DataGrid.ResetHeaderFont Method

Definition

Resets the HeaderFont property to its default value.

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

Examples

The following code example demonstrates the use of this member.

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

Remarks

You typically use this method if you are either creating a designer for the System.Windows.Forms.DataGrid or creating your own control incorporating the System.Windows.Forms.DataGrid. You can use the ShouldSerializeHeaderFont method to determine whether the property value has changed from its default.

Applies to