Hi all,
is there a way to listen for keydown events on all controls at the same time? I am capturing a barcode scanner's input and the scanner is hooked to a pc. On barcode lock, it simply pastes the number. This means that whatever control currently has the focus, gets also the number.
This works but only if the form itself has the focus. Do I have to check the keydown event of every control or is there an event that fires each time, regardless of where the focus is.VB Code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown 'MessageBox.Show(e.KeyValue.ToString) helped me to get the keycode txtBarcode.Focus() End Sub
I guess I could use ZaNi's idea but would it be at all sane with 50+ controls?




Reply With Quote