DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Easy Question

  1. #1
    Join Date
    Jul 2005
    Posts
    1

    Easy Question

    This should be so easy, I can't believe I'm asking.

    I have a form with several textboxes. When the user enters data into each box, I want the focus to shift to the next textbox in the tab order when the input reaches two characters. Is there an easier way to do this than to code each individual textbox's _change event?

    Thanks.

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    You could use a control array so your code will be centralized in one event procedure (for all TextBoxes).
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Code:
    Private Sub Text1_Change()
        If Len(Text1.Text) >= 2 Then
            SendKeys "{TAB}"
        End If
    End Sub
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center