This is a C#, Winform question.
I have a TabControl control and I use two navigation buttons to switch among my tab pages. I used TabControl.SelectedIndex = i to change the showing tab pages in the buttons' click event. Every time a specific tab page is going to be shown, one of several functions is called to prepare some background work. The calls to the functions are put to TabControl.SelectedIndexChanged event.
I came across a problem. If an exception is thrown from TabControl.SelectedIndexChanged event (from one of the several functions get called in that event), I no longer can use the programmatic way to switch among tab pages. Once one exception is thrown, the navigation buttons cannot change the showing tab of the TabControl. Be more specifically, the SelectedIndex of TabControl still can be changed, the tabs UI still changes but the tab page content remains the same as the page that having exception thrown out.
Anyone came across this problem before? Any solution? Many thanks.