False ItemCheck Event?

R

Ray Mitchell

Hello,

I have a standard ListView control with the CheckBox and MultiSelect
properties enabled. I have an ItemCheck event set up so I can do some work
every time an item is checked/unchecked. Let's assume I have two items in
the list. The weird part comes when I hold down the control key and select
(not check) the items one at a time. When I select the first one it works
fine. However, when I select the second one it does become selected, as
expected, but it also checks the first item and the ItemCheck event occurs.
By merely holding the control key down and selecting/deselecting various
entries I also can turn the checks on and off in a seemingly random fashion.
Is this a feature? If so, is there a clean way to turn it off?

Thanks,
Ray Mitchell
(e-mail address removed)
 
R

Ray Mitchell

Ray Mitchell said:
Hello,

I have a standard ListView control with the CheckBox and MultiSelect
properties enabled. I have an ItemCheck event set up so I can do some work
every time an item is checked/unchecked. Let's assume I have two items in
the list. The weird part comes when I hold down the control key and select
(not check) the items one at a time. When I select the first one it works
fine. However, when I select the second one it does become selected, as
expected, but it also checks the first item and the ItemCheck event occurs.
By merely holding the control key down and selecting/deselecting various
entries I also can turn the checks on and off in a seemingly random fashion.
Is this a feature? If so, is there a clean way to turn it off?

Thanks,
Ray Mitchell
(e-mail address removed)
I also noticed that if I double-click on an item (I also have a double-click
event) the check status toggles and an ItemCheck event occurs. All of this
must be correct behaviour that I just don't quite understand!
 
T

Tom Carter

Ray,

Have you considered putting into your event logic a reference to the
selectedindex that called the action to determine what action you
would like to take?

~~~~~~~~~~~~~
Tommie Carter
www.premiertechnology.com
--
 
R

Ray Mitchell

That would probably work, but I don't understand why the simple approach I
have taken doesn't work. Should I expect a double-click or a multiple
selection to also cause a check event? It just doesn't make sense.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top