Author Topic: Lock keyboard function in text box and allow usb barcode scanner data input  (Read 1134 times)

Padex

  • Newbie
  • *
  • Posts: 11
    • View Profile
Hi Guys,

How to lock text box by manual key in by keyboard and allow barcode scanner only.
this to prevent  of human error (typo).

I have no idea how to lock text box...
below is what i did.. but this will be lock once one number is fill in... any idea to delay for 1 sec then lock textbox or any step is more effective.

help me guys.... Im blur...

Code: [Select]
Private Sub Acu1PreCA1_ValueChanged(sender As Object, e As EventArgs) Handles Acu1PreCA1.TextChanged

        Acu1PreCA1.Text = CStr(Acu1PreCA1.Text)
        Try
            If Acu1PreCA1.Text = l Then
                MsgBox("Confirm Value")

                Acu1PreCA1.Enabled = False

            End If
        Catch ex As Exception

        End Try


    End Sub

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
If you are using a keyboard wedge scanner, this may be difficult because the application has no way of knowing whether it is typed on a keyboard or comes from a scanner. To distinguish keyboard input from barcode input, you would need a scanner that does COM port emulation.

Padex

  • Newbie
  • *
  • Posts: 11
    • View Profile
Any Idea how to recognize com port 1 link with vb as well... how to switch handles by com1 scanner

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
In the sample projects, there is a raw serial port read demo:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects/