471,330 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

How to set tab focus?

I have a tab control with four pages:

- tab1
- tab2
- tab3
- tab4

If some one clicks tab3 and then clicks a button completely off of the
tab control, I want tab1 to have focus and display what ever is on tab
one. I have tried tab1.focus() but that doesn't work.

Using VS2K5. Any suggestions?


Feb 14 '06 #1
1 7965
It's rather counterintuitive, but you have to manipulate the enclosing
TabControl, not the TabPage:

this.tabControl1.SelectedIndex = 2;

to select the third tab page.

Feb 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Nitin | last post: by
3 posts views Thread by VA | last post: by
17 posts views Thread by Neil Ginsberg | last post: by
1 post views Thread by avnrao | last post: by
11 posts views Thread by Alex.Svetos | last post: by
7 posts views Thread by Dave Booker | last post: by
3 posts views Thread by jp2express | 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.