DataGrid.RowHeaderWidth 属性

定义

获取或设置行标题宽度。

public:
 property int RowHeaderWidth { int get(); void set(int value); };
public int RowHeaderWidth { get; set; }
member this.RowHeaderWidth : int with get, set
Public Property RowHeaderWidth As Integer

属性值

Int32

DataGrid 中行标题的宽度。 默认值为 35。

示例

下面的代码示例演示了此成员的使用。

   // 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 = myDataGrid.RowHeaderWidth;
   MessageBox.Show("Width of row headers is: "+ 
            myRowHeaderWidth.ToString(), "Message",
            MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
' 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

适用于