Tricky TabControl

rustyd

Centurion
Joined
Mar 5, 2003
Messages
112
When I change the selectedindex of the tabcontrol, the first textbox in the tabpage container receives OnEnter before the SelectedIndexChanged event fires.

What is the event order for the tabcontrol? what ends up happening is OnEnter of the textbox I'm validating the previous textbox (from the previous tabpage) which fails, so I set the SelectedIndex back to the previous tabpage index. This results in tabpage being hidden. If I set the SelectedTab = TabPage1 then I the correct page is visible, the correct textbox has focus, but the tab at the top is still showing tabpage2 as selected eventhough it is showing the first page.

Any suggestions.
 
Back
Top