listview.itemcheck and listview.itemchecked

 

光从MSDN上看不出什么区别,这是在国外的一个论坛里找到的,转载了

The ItemCheck event is triggered when the checked state of an item is about to change, allowing you to examine the old and new value, and to cancel the change if you wish (by assigning the NewValue property of the eventargs parameter). ItemChecked is triggered after the check (or uncheck) is completed.

Code sample:

private void ListView_ItemCheck(object sender, ItemCheckEventArgs e)
{
// the checked state of an item is about to change
if (e.NewValue == CheckState.Checked)
{
// perform some check if this is allowed, and if not...
e
.NewValue = e.CurrentValue;
}
}

private void ListView_ItemChecked(object sender, ItemCheckedEventArgs e)
{
// the checked state of an item has changed
}

你可能感兴趣的:(ListView)