我希望ListView的火事件ColumWidthChanging不允许更改宽度列listview
拜托,有人帮助我!!!
MyUserControl中的代码:
public event EventHandler columnWidthChangingListViewCategoryClick;
private void listView_Category_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
{
if (columnWidthChangingListViewCategoryClick != null)
{
columnWidthChangingListViewCategoryClick(sender, e);
}
if (e.ColumnIndex == 1 || e.ColumnIndex == 3)
{
e.NewWidth = 0;
e.Cancel = true;
}
}
我在Form1中的代码:
My_UC.columnWidthChangingListViewCategoryClick += new EventHandler(columnWidthChangingListViewCategoryClick_MyUC);
private void columnWidthChangingListViewCategoryClick_MyUC(object sender, EventArgs e) { }
我的代码不是火