471,605 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Tab control -switching

A user is on a control (textbox) on a tab and I have code in the leave
event of the textbox that must validate input.
After typing in the text box the user then clicks on another tab.
My leave event fires (text box), and I try and set focus back on the
textbox, but the tab control does not let me. Instead the user goes to
the next selected tab after saying OK to my dialog box (leave event).
How can I keep them focused on the correct tab?

Jan 30 '06 #1
2 1999
Don't use the Leave event to do validation. Use the Validating event,
and set e.Cancel = true on the event arguments if validation fails. The
user will not be able to leave the text box if validation fails.

Jan 30 '06 #2
Thanks Bruce. this helped out imensley

Jan 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by martin | last post: by
2 posts views Thread by John Lau | last post: by
5 posts views Thread by serge calderara | last post: by
4 posts views Thread by gsb58 | last post: by
5 posts views Thread by paul.hester | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.