DataGridColumnStyle.WidthChanged 事件

定义

Width 属性值更改时发生。

public:
 event EventHandler ^ WidthChanged;
public event EventHandler WidthChanged;
member this.WidthChanged : EventHandler 
Public Custom Event WidthChanged As EventHandler 

事件类型

EventHandler

示例

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

// Add the 'Customer ID' column style.
DataGridColumnStyle^ myIDCol = gcnew DataGridTextBoxColumn;
myIDCol->MappingName = "custID";
myIDCol->HeaderText = "Customer ID";
myIDCol->Width = 100;
myIDCol->WidthChanged += gcnew EventHandler( this, &MyForm::MyIDColumnWidthChanged );
myDataGridTableStyle->GridColumnStyles->Add( myIDCol );
// Add the 'Customer ID' column style.
DataGridColumnStyle myIDCol = new DataGridTextBoxColumn();
myIDCol.MappingName = "custID";
myIDCol.HeaderText = "Customer ID";
myIDCol.Width = 100;
myIDCol.WidthChanged += new EventHandler(MyIDColumnWidthChanged);
myDataGridTableStyle.GridColumnStyles.Add(myIDCol);
' Add the 'Customer ID' column style.
Dim myIDCol As DataGridTextBoxColumn = New DataGridTextBoxColumn()
myIDCol.MappingName = "custID"
myIDCol.HeaderText = "Customer ID"
myIDCol.Width = 100
AddHandler myIDCol.WidthChanged, AddressOf MyIDColumnWidthChanged
myDataGridTableStyle.GridColumnStyles.Add(myIDCol)

适用于