次の方法で共有


DataGrid.RowHeaderWidth プロパティ

行ヘッダーの幅を取得または設定します。

Public Property RowHeaderWidth As Integer
[C#]
public int RowHeaderWidth {get; set;}
[C++]
public: __property int get_RowHeaderWidth();public: __property void set_RowHeaderWidth(int);
[JScript]
public function get RowHeaderWidth() : int;public function set RowHeaderWidth(int);

プロパティ値

System.Windows.Forms.DataGrid の行ヘッダーの幅。既定値は 50 です。

使用例

 
' Get the width of row header.
Private Sub button9_Click(ByVal sender As Object, ByVal e As EventArgs) Handles button9.Click
    Dim myRowHeaderWidth As Int32 = myDataGrid.RowHeaderWidth
    MessageBox.Show("Width of row headers is: " + myRowHeaderWidth.ToString(), "Message", MessageBoxButtons.OK,         MessageBoxIcon.Exclamation)
End Sub 'button9_Click

[C#] 
// Get the width of row header.
private void button9_Click(object sender, EventArgs e)
{
   Int32 myRowHeaderWidth = myDataGrid.RowHeaderWidth;
   MessageBox.Show("Width of row headers is: "+ 
            myRowHeaderWidth.ToString(), "Message",
            MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}      

[C++] 
// Get the width of row header.
void button9_Click(Object* /*sender*/, EventArgs* /*e*/) {
    Int32 myRowHeaderWidth = myDataGrid->RowHeaderWidth;
    MessageBox::Show(String::Concat(S"Width of row headers is: ",
        __box(myRowHeaderWidth)), S"Message",
        MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
}

[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 名前空間