DataGridTableStyle.PreferredRowHeightChanged 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当 PreferredRowHeight 值更改时发生。
public:
event EventHandler ^ PreferredRowHeightChanged;
public event EventHandler PreferredRowHeightChanged;
member this.PreferredRowHeightChanged : EventHandler
Public Custom Event PreferredRowHeightChanged As EventHandler
事件类型
示例
下面的代码示例演示了此成员的使用。
void SetUp()
{
// Create a DataSet with a table.
MakeDataSet();
// Bind the DataGrid to the DataSet.
myDataGrid->SetDataBinding( myDataSet, "Orders" );
myTableStyle = gcnew DataGridTableStyle;
// Map 'DataGridTableStyle' instance to the DataTable.
myTableStyle->MappingName = "Orders";
// Add EventHandler function for 'PreferredRowHeightChanged' Event.
myTableStyle->PreferredRowHeightChanged += gcnew EventHandler( this, &MyDataForm::RowHeight_Changed );
}
// Called when the PreferredRowHeight property of myTableStyle is modified
void RowHeight_Changed( Object^ /*sender*/, EventArgs^ /*e*/ )
{
MessageBox::Show( "PreferredRowHeight property is changed" );
}
private void SetUp()
{
// Create a DataSet with a table.
MakeDataSet();
// Bind the DataGrid to the DataSet.
myDataGrid.SetDataBinding(myDataSet, "Orders");
myTableStyle = new DataGridTableStyle();
// Map 'DataGridTableStyle' instance to the DataTable.
myTableStyle.MappingName = "Orders";
// Add EventHandler function for 'PreferredRowHeightChanged' Event.
myTableStyle.PreferredRowHeightChanged+=new EventHandler(RowHeight_Changed);
}
// Called when the PreferredRowHeight property of myTableStyle is modified
private void RowHeight_Changed(object sender, EventArgs e)
{
MessageBox.Show("PreferredRowHeight property is changed");
}
Private Sub SetUp()
' Create a DataSet with a table.
MakeDataSet()
' Bind the DataGrid to the DataSet.
myDataGrid.SetDataBinding(myDataSet, "Orders")
myTableStyle = New DataGridTableStyle()
' Map 'DataGridTableStyle' instance to the DataTable.
myTableStyle.MappingName = "Orders"
' Add EventHandler function for 'PreferredRowHeightChanged' Event.
AddHandler myTableStyle.PreferredRowHeightChanged, AddressOf RowHeight_Changed
End Sub
' Called when the PreferredRowHeight property of myTableStyle is modified
Private Sub RowHeight_Changed(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("PreferredRowHeight property is changed")
End Sub
注解
有关处理事件的详细信息,请参阅 “处理和引发事件”。