Skip to main content

[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??

[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??
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.


[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??
Most excellent.

Thanks.