1

How can I trigger unchecking box action in a ListView control ? In default ListView events I can only see ItemCheck and ItemChecked event where is ItemUnchecked and ItemUncheck?

4

1 回答 1

3

处理ItemCheck事件并读取NewValue属性以确定它是否将被选中或取消选中。

private void myListView_ItemCheck(object sender, ItemCheckEventArgs e)
{
    if (e.NewValue == CheckState.Unchecked)
    { 
        //unchecked
    }       
    else if(e.NewValue == CheckState.Checked)
    {
        //checked
    }               
}
于 2013-07-28T14:43:00.777 回答