Results 1 to 3 of 3

Thread: sstab focus question

  1. #1
    Guest
    i have four tabs
    each of the tabs have textboxes on them

    i want one textbox on each tab to receive
    the focus when a user clicks on any tab

    i can't seem to get it done,
    anyone with an answer?

    thankxs in advance

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Something like:

    Code:
    Select Case sstTab.Tab
        Case Is = 0
            sstTab.field0.setfocus
        Case Is = 1
            sstTab.field1.setfocus
        Case Is = 2
            sstTab.field2.setfocus
        Case Is = 3
            sstTab.field3.setfocus
    End Select

  3. #3
    Guest
    If your TextBoxes are in an Array, use the following:
    Code:
    Private Sub SSTab1_Click(PreviousTab As Integer)
    
        For i = 0 To SSTab1.Tabs
            If SSTab1.Tab = i Then Text1(i).SetFocus
        Next i
    
    End Sub
    If not, use this code:
    Code:
    Private Sub SSTab1_Click(PreviousTab As Integer)
    
        For i = 0 To SSTab1.Tabs
            If SSTab1.Tab = 0 Then Text1.SetFocus
            If SSTab1.Tab = 1 Then Text2.SetFocus
            If SSTab1.Tab = 2 Then Text3.SetFocus
        Next i
    
    End Sub

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