Skjori
asked on
Event triggered several times at once
Why do the selectedIndexChanged-event on the ListBox trigg four times when I click an item in the list once?
How do I avoid that? Can I use another event?
How do I avoid that? Can I use another event?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Set a break point in the event and catch it triggering several times.
Each time you enter break mode, check the Sender object. The Sender object may be different when you get the event when you think you shouldn't be getting it. Sometimes you can check the sender object type and selectively enter your method code based on the sender.
Each time you enter break mode, check the Sender object. The Sender object may be different when you get the event when you think you shouldn't be getting it. Sometimes you can check the sender object type and selectively enter your method code based on the sender.
Hmmm, that advice sorta sounds familiar :)
Bob
Bob
ASKER