ListView在虚模式下,CheckBox无法点击,可以用此方法实现
代码如下 | 复制代码 |
privatevoidlvwTitle_MouseDown(objectsender, MouseEventArgs e)
{ Point curPos =this.lvwTitle.PointToClient(Control.MousePosition); ListViewItem lvwItem =this.lvwTitle.GetItemAt(curPos.X, curPos.Y);
if(lvwItem !=null) { lvwItem.Checked = !lvwItem.Checked; lvwTitle.Refresh(); }
} |