I am working on creating a keypad for a VB.Net Application I am working on. The Keypad's purpose is to help users who are using the app on a touchpad station that does not have a mouse or keyboard.
This is the code I have used to set up the Keypad:
Public Class Keypad
Private Sub Keypad_Load(sender As Object, e As Event Args) Handles MyBase.Load
Me.TopMost = True
End Sub
Protected Overrides ReadOnly Property CreateParams As CreateParams
Get
Const WS_EX_NOACTIVATE As Int32 = &H8000000
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or WS_EX_NOACTIVATE
Return cp
End Get
End Property
Private Sub btn0_Click(sender As Object, e As EventArgs) Handles btn0.Click
SendKeys.Send("0")
End Sub
Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btn1.Click
SendKeys.Send("0")
End Sub
'all other button methods are the same as above
So the Keypad itself is a simply setup. Standard Numpad 1-9 layout, as well as a 'Clear' and 'Enter' button.
I am currently having the following problems with the Keypad:
While in the VB.Net I have created the Keypad for, attempting to use the Keypad does nothing. However if I open Notepad and have given focus to Notepad, using the Keypad will type numbers into Notepad.
The Login Screen for the Application is setup as a Dialogue Window, and I am unable to modify that (legacy code issues). This means the Keypad is both unmovable, and unusable while the Login Screen is open.
The 'Clear' Button is suppose to remove all data in whatever form element has focus when the button is selected. However, I am not exactly sure how to program this, and how to make it so that it doesn't completely bug out the Keypad if the user has a non VB.Net application focused when the key is pressed.
EDIT: After doing some testing, it turns out the Keypad works fine if I set it up as a completely separate Project. So it turns out the issue seems to be the Keypad Form being part of the initial project I was creating it for.