Hi guys,
it's probably really easy, but I'm just starting out and need a bit of help.
How can i get my form to go automatically to the next textbox once the maximum charcters have been filled in
(If I'm posting in the wrong place tell me)
thanks,
chris
(it's hard being new :-( )

Auto Tab
BobSw
"length is not a member of System.Windows.Forms.Form"
Private
Sub TextBoxZichtrekening1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxZichtrekening1.TextChanged 'TextBoxZichtrekening1.Length = 3 If TextBoxZichtrekening1.Length = TextBoxZichtrekening1.MaxLength ThenTextBoxZichtrekening2.Focus()
End If End Subam I doing something wrong
thanks again,
Chris
tml2004
You need try a little bit to see whether it is the behavior you want.
Since you could have many TextBoxes like this on your form. You can create your own TextBox class, which inherits from the standard TextBox, so you won't dup that code.
Lifeng
Ken Byrd
Private
Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChangedTextBox1.MaxLength = 10
If TextBox1.Text.Length = TextBox1.MaxLength ThenTextBox2.Focus()
End If End SubThe length property for the Textbox is for the Length of the TEXT in the textbox.
that is where your problem is.
The sample I included uses only two textboxes. If you have several on the form, the Tab Order could effect this code. ( I haven't tested it to see)
james
aka:Trucker
Joe2007
I'll probably be back in with more questions later on.
thanks everyone for helping,
Chris
hebert
but I'm really new - (and not very good - but I'm trying)
this is what I've written so far:
Private
Sub TextBoxZichtrekening1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxZichtrekening1.TextChangedTextBoxZichtrekening1.MaxLength = 3
If TextBoxZichtrekening1.MaxLength ThenTextBoxZichtrekening2.Focus()
End IfEnd Sub
but it goes to the next tab after one number is entered not three
Sorry, if I'm being dumb
can you help
Thanks again.
chris
kunal.kb