DataGrid.RowHeaderWidth 属性

获取或设置行标头宽度。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Property RowHeaderWidth As Integer
用法
Dim instance As DataGrid
Dim value As Integer

value = instance.RowHeaderWidth

instance.RowHeaderWidth = value
public int RowHeaderWidth { get; set; }
public:
property int RowHeaderWidth {
    int get ();
    void set (int value);
}
/** @property */
public int get_RowHeaderWidth ()

/** @property */
public void set_RowHeaderWidth (int value)
public function get RowHeaderWidth () : int

public function set RowHeaderWidth (value : int)

属性值

System.Windows.Forms.DataGrid 中行标头的宽度。默认值为 35。

示例

' 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
// 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);
}      
   // Get the width of row header.
private:
   void button9_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      Int32 myRowHeaderWidth = myDataGrid->RowHeaderWidth;
      MessageBox::Show( String::Concat( "Width of row headers is: ", myRowHeaderWidth ), "Message", MessageBoxButtons::OK, MessageBoxIcon::Exclamation );
   }
// Get the width of row header.
private void button9_Click(Object sender, EventArgs e)
{
    Int32 myRowHeaderWidth = (Int32)myDataGrid.get_RowHeaderWidth();
    MessageBox.Show("Width of row headers is: " 
        + myRowHeaderWidth.ToString(), "Message", 
        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
} //button9_Click

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

DataGrid 类
DataGrid 成员
System.Windows.Forms 命名空间