DataGridTableStyle.RowHeaderWidth 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置行标题宽度。
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
属性值
行标题的宽度(以像素为单位)。
示例
下面的代码示例演示了此成员的用法。
private:
void CallEventLoader()
{
this->Load += gcnew EventHandler( this, &DataGridTableStyle_RowHeaderWidth::DataGridTableStyle_RowHeaderWidth_Load );
}
public:
void AttachRowHeaderWidthChanged()
{
myDataGridTableStyle->RowHeaderWidthChanged +=
gcnew EventHandler( this, &DataGridTableStyle_RowHeaderWidth::MyDelegateRowHeaderChanged );
}
private:
void MyDelegateRowHeaderChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
MessageBox::Show( "Row header width is changed" );
}
void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
myDataGridTableStyle->RowHeaderWidth = 30;
}
void button2_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
MessageBox::Show( String::Concat( "Row header width is: ", myDataGridTableStyle->RowHeaderWidth ) );
}
private void CallEventLoader()
{
this.Load += new EventHandler(
this.DataGridTableStyle_RowHeaderWidth_Load);
}
public void AttachRowHeaderWidthChanged()
{
myDataGridTableStyle.RowHeaderWidthChanged +=
new EventHandler(MyDelegateRowHeaderChanged);
}
private void MyDelegateRowHeaderChanged(object sender, EventArgs e)
{
MessageBox.Show("Row header width is changed");
}
private void button1_Click(object sender, System.EventArgs e)
{
myDataGridTableStyle.RowHeaderWidth = 30;
}
private void button2_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Row header width is: " +
myDataGridTableStyle.RowHeaderWidth);
}
Private Sub CallEventLoader()
AddHandler Load, AddressOf DataGridTableStyle_RowHeaderWidth_Load
End Sub
Public Sub AttachRowHeaderWidthChanged()
AddHandler myDataGridTableStyle.RowHeaderWidthChanged, AddressOf MyDelegateRowHeaderChanged
End Sub
Private Sub MyDelegateRowHeaderChanged(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Row header width is changed")
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
myDataGridTableStyle.RowHeaderWidth = 30
End Sub
Private Sub button2_Click(sender As Object, e As EventArgs) Handles button2.Click
MessageBox.Show("Row header width is: " & myDataGridTableStyle.RowHeaderWidth)
End Sub
注解
当行标题可见时,如果基础数据具有相关的子表,则会在每个行标题中显示加号。
在将 对象添加到 DataGridTableStyle 之前, GridTableStylesCollection此属性将无法正常工作。 在此之前,设置此属性将不起作用。