Absent Member.
Absent Member.
1192 views

Autotabbing on a form?

Jump to solution

[Migrated content. Thread originally posted on 14 May 2012]

Is there a property I can set on a Winform to allow for immediate tabbing to the next field once the field I'm completing becomes full.

I'm attempting to program a bank sort code fill with 3 fields (each of size 2) which I want to 'bounce' from field to field once I've completed each field of 2 characters without the user having to press the tab key themselves.

I've looked in the properties box and on the msdn material but nothing is apparent??
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
Set the MaxLength property on each of the text fields to the desired length.

Then create an event handler for the TextChanged event on each textbox by highlighting it in forms designer, clicking the lightning bolt icon in the properties window and double clicking on TextChanged.

Make them look something like this:


       method-id textBox1_TextChanged final private.
       procedure division using by value sender as object e as type System.EventArgs.
           if textBox1::TextLength = textBox1::MaxLength
              invoke textBox2::Focus
           end-if
           
       end method.

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert
Set the MaxLength property on each of the text fields to the desired length.

Then create an event handler for the TextChanged event on each textbox by highlighting it in forms designer, clicking the lightning bolt icon in the properties window and double clicking on TextChanged.

Make them look something like this:


       method-id textBox1_TextChanged final private.
       procedure division using by value sender as object e as type System.EventArgs.
           if textBox1::TextLength = textBox1::MaxLength
              invoke textBox2::Focus
           end-if
           
       end method.

View solution in original post

0 Likes
Absent Member.
Absent Member.
Most excellent.

Thanks.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.