Results 1 to 5 of 5

Thread: newbie question: Tabindex In SStab... Help..

  1. #1

    Thread Starter
    Junior Member BUTTMAN's Avatar
    Join Date
    Apr 2002
    Posts
    27

    newbie question: Tabindex In SStab... Help..

    can anyone suggest or help me how can i group the tabindex accdng to sstab,
    egi:
    im using a form with 7 sstab: each tab consist of several diffrent controls, now my problem is everytime i press tab it just continue to jump from the next control even to the controls of inactive sstab.. how can i manage it so it can just loop from the active sstab's controls.. (hope this make sense!!!)
    =====
    To follow the path:
    look to the master,
    follow the master,
    walk with the master,
    see through the master,
    become the master.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    First store the TabStop property values of all the controls on the sstab at Form Load. Then when a particular tab gets selected, set the TabStop property of the controls on the other tabs to False and the TabStop property of the controls on the current tab to whatever was stored in the load.

  3. #3

    Thread Starter
    Junior Member BUTTMAN's Avatar
    Join Date
    Apr 2002
    Posts
    27
    thankx sir..
    but is it possible with just too many diffrent controls on one sstab..? will it make my code larger if i will set their tabstop to false on every event that i click sstab?
    =====
    To follow the path:
    look to the master,
    follow the master,
    walk with the master,
    see through the master,
    become the master.

  4. #4
    Frenzied Member John McKernan's Avatar
    Join Date
    Jan 2002
    Location
    SE PA
    Posts
    1,295
    Two solutions come to mind:

    1. Use control arrays (ie: Text1(0), Text1(1)... etc) this would make setting their tab stops a lot shorter:
    VB Code:
    1. Dim i as integer
    2. For i = 0 to Text1.Count - 1
    3.     Text1(i).TabStop = False
    4. Next i

    2.
    a). Place another control (probably a textbox) on each tab. this should be set to a backcolor & forecolor the same as the tab color, no border and as small as possible (use a small font - it won't be seen anway).

    b). Carefully set your tab order so that this textbox is the last on each tab

    c). In the _GotFocus event for this textbox, you can include the code to redirect the tab as needed. For Example (assuming the added textbox is called txtTabStop):

    VB Code:
    1. Private Sub txtTabStop_GotFocus(...)
    2.    Text1.SetFocus
    3. End Sub

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Originally posted by BUTTMAN
    is it possible with just too many diffrent controls on one sstab..? will it make my code larger if i will set their tabstop to false on every event that i click sstab?
    You don't need to worry about it. You could change the TabStop property of hundreds of controls and not notice it happening.

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