Results 1 to 11 of 11

Thread: Skip to Next Box

  1. #1

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    How can I make the textboxes detect when they are filled up and then skip to the next text box... and I tend to place my boxes out of order due to rearranging stuff all of the time, how do I rearrange the order they go in when you hit tab..?
    That arranged can be

  2. #2
    Member PatrickCorgan's Avatar
    Join Date
    Feb 2001
    Location
    Vashon Island, WA, USA
    Posts
    39
    Each textbox has a TabStop property. Focus starts on TabStop 0, then goes to 1, etc...
    -Patrick
    Visual Basic 6 SP5
    Master Programmer Wannabe

    Check out the API-Guide for all your API needs!

    --Soli Deo Gloria--

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Work it backwards...go to your controls and set the tabIndex to 0 and keep setting each and every one to 0 till you reach the one that you want first. Now all your tabs will be in the order you want...tabbing from first to last.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    allright, thanks that worked fine, but what about the skip thing? Kind of like how Microsoft and other programs do with the cdkeys when you enter them... You enter the first few numbers, then when that box is filled, it skips to the next...
    That arranged can be

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    the easiest way would be to use a control array...

    Code:
    Private Sub Text1_Change(Index As Integer)
    On Error Resume Next   'needs to be here
    
      If Len(Text1(Index).Text) = 5 Then   '5 or what ever number
        Text1(Index + 1).SetFocus
      EndIf
    End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    it says...

    procedure declaration does not match description of event or procedure having the same name
    ???????
    That arranged can be

  7. #7
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    do you have it set up as a control array?? ie - Text1(0), Text1(1), and so on??
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  8. #8

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    lol, do now, and it works.. but on the last one, i want them to be able to enter 4 digits... what should i do there? (btw, there are 3 boxes..)
    That arranged can be

  9. #9
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Code:
    Private Sub Text1_Change(Index As Integer)
    On Error Resume Next   'needs to be here
    
      If Len(Text1(Index).Text) = Text1(Index).MaxLength Then
        Text1(Index + 1).SetFocus
      EndIf
    End Sub
    I think that will work...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  10. #10

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472
    Thanks! You have been great help!
    Last edited by Sacofjoea; Mar 3rd, 2001 at 04:08 PM.
    That arranged can be

  11. #11
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    for some reason my last post was edited instead of making a new post, just look up...
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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