How can i select and display 2nd tab rather than the 1st(default)tab when i load a form?
Printable View
How can i select and display 2nd tab rather than the 1st(default)tab when i load a form?
try this (assumes you want the second Tab, it starts at Zero)
Code:Private Sub Form_Load()
Me.tabControl.Pages(1).SetFocus
End Sub
Sorry, i can't get what u mean. I try to use ur code but i can't find the command u give me.Quote:
Originally posted by Steven McGarva
try this (assumes you want the second Tab, it starts at Zero)
Code:Private Sub Form_Load()
Me.tabControl.Pages(1).SetFocus
End Sub
Hi Leeckeat:
Use this procedure, I don't know if it's the correct way but it works:
In the tab's caption use the "&" (ampersand) character to underline a character that you can use with de ALT key, e.g. "TAB&2", when you conbine the keys ALT+2 the tab-2 will be selected. Then when you load the form use the "SENDKEYS" command:
Private Sub Form1_Load()
SendKeys "%2"
End Sub
The "%" character represents the ALT key.
When the form is loaded it'll send the keys ALT+2 and in the TabStrip the tab-2 will be selected, check this in the Load or Activate events on the form.
I hope this can help you.
Best regards.
Assume you have not changed the default names of the controls, this should work fine.
hope this helps,Code:Private Sub Form_Load()
Form1.TabStrip1.Tabs(2).Selected = True
End Sub
Shaun
Try this:
Code:Private Sub Form_Load()
TabStrip1.Tabs(2).Selected = True
End Sub
Yes, yes.
Your rigth my friends, I was living in the dark, sorry!!
I'm going to change my code, Thanks.