Solved Form.KeyDown not working with buttons

Teggun

Registered User.
Local time
Today, 21:42
Joined
Aug 30, 2019
Messages
33
Hi guys,

I'm having a trouble with a form where I am using a KeyDown and KeyUp event to enter a pin and log in the database, and it works nicely when all the elements on it are labels, but it appears that when adding a button on it it stops working. I think this is because the button gets the focus when loading the form and prevents the events to work.
Is there any solution to make this whole set work when having some buttons in the form?

Thanks in advance for your time and help.
 
Set the focus to the textbox where the PIN is entered
 
The problem is that can't set focus on it as the text box is not enabled. This is because I need the user to not type directly on it, but using numbers on the keyboard or clicking the numbers in the form.
In the set up, the only buttons are "Entrar/In" and "Salir/Out".
Any idea how I could make this work?

IMG.png
 
set the Main Form's Key Preview property to Yes.
 
So set the control to Locked and Enabled = Yes?
 
Agree with the above and set focus to one of the numbers on the form
 
see this demo the txtPin is Disabled.
and setting the Form's Key Preview property to Yes.
 

Attachments

Users who are viewing this thread

Back
Top Bottom