I have a tab control with different pages. When starting up the form with this tab control the tabs get lost and the inner page gets all the screen focus. The tab control is used for navigation so the user will get lost this way.
Is there any way to let the tabs be visible on the screen without just resizing the screen to be smaller?
Desired result:
+--------------------+
| Tab1 | Tab2 | Tab3 |
+--------------------+
| Name: ______ |
Actual screen:
^
+--------------------+ |_|
| Name: ______ | | |
Reducing the size of the tab control works (as you discovered yourself), however there is an alternative workaround:
OnOpenorOnLoadevent, call the.SetFocusmethod on the command buttonSendKeys(I know, I know…) to tab to the Tab ControlSample code:
Explanation of the above steps:
Miscellaneous Notes: At the asker’s request I am including a couple of comments as part of the answer itself:
For those who may find this answer in the future, please take note that Step 5 above is only necessary if you need the tab control to receive keyboard focus (a critical requirement for the original asker). If you can live without it, I would suggest that you do.
UPDATE: As David Fenton points out in the comments, you can use
Ctl+Tab/Ctl+Shift+Tabto move back and forth between the tabs. This is consistent with most tabbed interfaces (eg, browsers) and eliminates the need to useSendKeys.