Results 1 to 7 of 7

Thread: need tabstrip expert

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Penang, Malaysia
    Posts
    51
    How can i select and display 2nd tab rather than the 1st(default)tab when i load a form?

  2. #2
    Addicted Member
    Join Date
    Jul 2000
    Location
    Scotland
    Posts
    184
    try this (assumes you want the second Tab, it starts at Zero)

    Code:
    Private Sub Form_Load()
        Me.tabControl.Pages(1).SetFocus
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Penang, Malaysia
    Posts
    51

    Question

    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.

  4. #4
    Lively Member
    Join Date
    Jan 1999
    Location
    México, D.F.
    Posts
    84
    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

  5. #5
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    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

  6. #6
    Guest
    Try this:
    Code:
    Private Sub Form_Load()
        TabStrip1.Tabs(2).Selected = True
    End Sub

  7. #7
    Lively Member
    Join Date
    Jan 1999
    Location
    México, D.F.
    Posts
    84
    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
  •  



Click Here to Expand Forum to Full Width