|
-
Aug 10th, 2000, 10:53 AM
#1
Thread Starter
Member
How can i select and display 2nd tab rather than the 1st(default)tab when i load a form?
-
Aug 10th, 2000, 11:06 AM
#2
Addicted Member
try this (assumes you want the second Tab, it starts at Zero)
Code:
Private Sub Form_Load()
Me.tabControl.Pages(1).SetFocus
End Sub
-
Aug 10th, 2000, 11:17 AM
#3
Thread Starter
Member
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
Sorry, i can't get what u mean. I try to use ur code but i can't find the command u give me.
-
Aug 10th, 2000, 11:39 AM
#4
Lively Member
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.
Angel Maldonado López.
VB Programmer
-
Aug 10th, 2000, 11:45 AM
#5
Addicted Member
Assume you have not changed the default names of the controls, this should work fine.
Code:
Private Sub Form_Load()
Form1.TabStrip1.Tabs(2).Selected = True
End Sub
hope this helps,
Shaun
-
Aug 10th, 2000, 11:46 AM
#6
Try this:
Code:
Private Sub Form_Load()
TabStrip1.Tabs(2).Selected = True
End Sub
-
Aug 10th, 2000, 12:17 PM
#7
Lively Member
Yes, yes.
Your rigth my friends, I was living in the dark, sorry!!
I'm going to change my code, Thanks.
Angel Maldonado López.
VB Programmer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|