0

In vb.net application I have 10 Textbox and value entered by Barcode scanner
So when one Textbox1 get the value by Barcode scanner the focus moved automatically to another Textbox2 and so on.

I have this code but its working.

Private Sub A1TextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles A1TextBox.TextChanged

        'If A1TextBox.Text.EndsWith(vbCrLf) Then
        'Me.SelectNextControl(A1TextBox, True, True, False, False)
        'End If
    End Sub
5
Contributors
11
Replies
53
Views
9 Months
Discussion Span
Last Post by Mr.M
0

I even put Textbox multiline and in textchanged event put the code for focus
But nothing happened

0

Well What I think you first need to do is that since you know your barcode try finding how many digits it has the for each textbox set its max to that value like if your barcode is 5 digits then set your text box's maxlenght to 5 then on the TextChange event insert an if statement to check if this textbox maxleght has been met or not, if the max is met then set the focus to the next textbox and so on to the end.

0

Maybe it has to do with the settings of your scanner.
I had that problem once.
Have a look at the scanner documentation.

0

Yes This is right.

I set the TextBox character limit to 7 as my barcode contains 7 characters.

I am using this code so working right now ok.

If A1TextBox.Text.Length=7 Then
A2TextBox.Focus ()
End If
0

Well I'm glad it worked. If your problem has been solved don't forget to mark the question as solved.

0

Do not post the same question on different forums while you are still getting response from the other forum just like how you did here.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.