How can I prevent listview item checked from double-click?
-
Hello all, I don't want my listview item to be checked when I double-click on it. I tried to catch double-click event, but it does not help me at all. The double-click event always occurs after the item checked event does. I met another problem with listview. I used
e.NewValue=e.CurrentValue
in my functionOnItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
that handles the item checked event. Bute.NewValue=e.CurrentValue
code does not work. Please someone talks to me what wrong with my listview? How can I do in this issue? Thanks for your help. -
Hello all, I don't want my listview item to be checked when I double-click on it. I tried to catch double-click event, but it does not help me at all. The double-click event always occurs after the item checked event does. I met another problem with listview. I used
e.NewValue=e.CurrentValue
in my functionOnItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e)
that handles the item checked event. Bute.NewValue=e.CurrentValue
code does not work. Please someone talks to me what wrong with my listview? How can I do in this issue? Thanks for your help.the item click event does occur before the double click ( because you've already clicked it the first time ,before releasing the mouse for the second click ), i think that you would have to determine if the user was clicking on the checkedbox area or over the actual label , then handle it that way. you can obviously do this :
listView1.SelectedItems[0].Checked=false;
but the user will see the checkbox flicker to checked then back to unchecked.
Private void ExpectingTwins(string twins)
{
switch(twins)
{
Case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
}
}