I have some validation logic and a TabControl. I want to prevent the user from switching tabs when the current one contains some error.
I have found some people asking the same and some people gave good answers as you can see here.
TabControl- preventing user from changing the selected tab: MessageBox causing bug
HOWEVER, as Fredrik Hedblad tell, when a MessageBox is shown while the selection is being canceled, the whole thing breaks down. It experiences a strange behavior. The event stops being raised (apparently) and if you minimize and restore the Window, it suddenly raised without interacting!!
Can somebody shed some light on this? Thanks a lot!!!
Here I have set up a Visual Studio solution with the problem. It has the code in the MainWindow.cs. Really simple, but doesn't work. Try to click some tab twice (after the Dialog shows) and you will notice it doesn't show the Dialog again, but if you minimize and restore, the Dialog shows automatically and the tab IS SELECTED!