DataGrid.ResetHeaderFont Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET