共用方式為


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)

適用於