I have a tab contol with two tabs. Each one containing listviews. When the selection change event of listview is fired, the selection change of tabcontrol is also fired. How can I prevent this?
+1
A:
Set the Handled property of the EventArgs object to true when you are done with the listview event so it wont route further up the tree...
e.Handled = true;
HTH
Arcturus
2009-07-01 11:30:57
You are right and it solves my problem. Thanks
Sauron
2009-07-01 11:41:47
My first assumption was that the events were independent, when they're clearly not.
ChrisF
2009-07-01 11:50:11
Nope, it is the same event.. It doesn't check the original source.. So its always a good idea to set your event on handled when you are done with it, to avoid suprises ;)..
Arcturus
2009-07-01 12:00:36
A:
Is your listview perhaps selecting a default item when the tab is selected?
James
2009-07-01 11:38:35