次の方法で共有


DataGrid.ResetHeaderFont メソッド

HeaderFont プロパティを既定値にリセットします。

Public Sub ResetHeaderFont()
[C#]
public void ResetHeaderFont();
[C++]
public: void ResetHeaderFont();
[JScript]
public function ResetHeaderFont();

解説

通常、 System.Windows.Forms.DataGrid のデザイナまたは System.Windows.Forms.DataGrid が組み込まれている独自のコントロールを作成する場合に、このメソッドを使用します。 ShouldSerializeHeaderFont メソッドを使用して、プロパティの値が既定値から変更されたかどうかを判断します。

使用例

 
' 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 'button6_Click

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


[C#] 
// 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();
}

[C++] 
private:
    // Set the header font to Arial with size 20.
    void button6_Click(Object* /*sender*/, EventArgs* /*e*/) {
        myDataGrid->HeaderFont = 
            new System::Drawing::Font(S"Arial", 20);
    }
    // Reset the header font.
    void button5_Click(Object* /*sender*/, EventArgs* /*e*/) {
        myDataGrid->ResetHeaderFont();
    }

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

DataGrid クラス | DataGrid メンバ | System.Windows.Forms 名前空間