TabPage Validating event firing when clicked on the currently selected tab
- by Ismail S
I'm doing things as said in How do I prevent the user from changing the selected tab page in a TabControl?
Things are working fine. But the validating event of tabpage1 occurs if I've tabpage1 is currently selected and user clicks on tabpage1 itself. and later when user clicks on tabpage2 validating event for tabpage1 doesn't fire.
What happens is if I do e.Cancel in validating event of tabpage1, in the above case, when user clicks on tabpage1 by mistake having tabpage1 already selected, it will prompt user that "Do you want to stay on current tab to save data or move from the current tab?". and if user clicks Stay but doesn't do any changes. And then when he correctly clicks tabpage2, Validating event of tabpage1 is not firing.
I've uploaded the sample application here. You can run and see the behavior to properly understand the problem