Results 1 to 5 of 5

Thread: [RESOLVED] textbox help.

  1. #1

    Thread Starter
    Hyperactive Member Condomx's Avatar
    Join Date
    Dec 2009
    Location
    Iligan City,Philippines
    Posts
    327

    Resolved [RESOLVED] textbox help.

    i have a 3 text box so what i want to do is if the user reach the maxlength that i assign on the text box 1 it must automatically go to text box 2 until it reach to the text box 3 without pressing the tab.

    any help will be heavenly appreciated.
    ~[L!f3 !s @ll @ab0ut l3@rn!ng]~

    ~*D0nt Give up, h0pe is always present*~

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: textbox help.

    If Len(Text1) = Text1.MaxLength Then Text2.SetFocus

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: textbox help.

    You can test the length in the Change event
    Code:
    Private Sub Text1_Change()
        If Len(Text1.Text) = Text1.MaxLength Then Text2.SetFocus
    End Sub
    
    Private Sub Text2_Change()
        If Len(Text2.Text) = Text2.MaxLength Then Text3.SetFocus
    End Sub
    Edited: Baja_yu got there first.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: textbox help.

    Code:
    Private Sub Text1_Change()
    'max length is 10
    If Len(Text1.Text) = 10 Then Text2.SetFocus
    End Sub
    
    Private Sub Text2_Change()
    'max length is 10
    If Len(Text2.Text) = 10 Then Text3.SetFocus
    End Sub
    
    Private Sub Text3_Change()
    'max length is 10
    If Len(Text3.Text) = 10 Then MsgBox "You are done hoss."
    End Sub

  5. #5

    Thread Starter
    Hyperactive Member Condomx's Avatar
    Join Date
    Dec 2009
    Location
    Iligan City,Philippines
    Posts
    327

    Re: textbox help.

    oh thank you.
    ~[L!f3 !s @ll @ab0ut l3@rn!ng]~

    ~*D0nt Give up, h0pe is always present*~

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