DataGridColumnStyle.WidthChanged 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生在 Width 屬性值變更時。
public:
event EventHandler ^ WidthChanged;
public event EventHandler WidthChanged;
member this.WidthChanged : EventHandler
Public Custom Event WidthChanged As 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)