• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

WebControls

I have a serials of text boxes and as I input data in one text and reach its max I want it to auto tab to the next text box.

I set the tab index and that works find
I set the max-length to what i wanted
I looked into setting the focus
0
Dell12805
Asked:
Dell12805
  • 3
1 Solution
 
magicdlfCommented:
Connect all the TextChanged events to this for all your textboxes
        private int maxText = 5;
        private void textBox_TextChanged(object sender, EventArgs e)
        {
            TextBox textBox = (TextBox)sender;
            if(textBox == null) return;
            if (textBox.Text.Length == maxText)
            {
                this.SelectNextControl((Control)sender, true, true, true, false);
            }
        }

0
 
magicdlfCommented:
Oops, it's web apps. My solution is for winforms. I believe you need javascript in this case.
0
 
magicdlfCommented:
0
 
Dell12805Author Commented:
Thanks that works.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now