Need help with a Touch Screen project.

Heavenly

Well-known member
Joined
Aug 22, 2005
Messages
53
Location
Puerto Rico
Programming Experience
1-3
I have several forms with buttons and textboxes (see photo below) I also have a virtual Keyboard that is called by these buttons to allow operator to enter text into the textboxes in these forms.

Question:
How the keyboard would know which form call it and where to put the text string the operator just entered?

I need some help with the code to do this:

If button1 on form2 was clicked, the keyboard come up then the keyboard text string must be placed in the corresponding textbox right next to the button that called it.

The problem I’m having is passing the form reference to the keyboard, I simply do not know how to tell the keyboard that, for example, form3 is the one calling and the textbox recipient is in that form and its name is textbox1.

Any help will be highly appreciated.

Thanks
 

Attachments

  • KeyBoard.JPG
    KeyBoard.JPG
    65.8 KB · Views: 93
  • Forms.JPG
    Forms.JPG
    59.2 KB · Views: 96
Hi
try this,

Dim focusDetector As Object
Private Sub AllTextBoxes_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles textbox1.GotFocus, textbox2.gotfocus.....

If Me.ActiveControl.Name = "textbox1" Then
focusDetector = textbox1
Else If Me.ActiveControl.Name = "textbox2" Then
focusDetector = textbox2
End If
end sub

'now with the keyboard buttons clicked
private sub keyBoard_click(....) a.click,b.click.............
focusDetector.Text=focusDetector.Text+sender.text
end sub

I hope it will work for you.
 
do it for every form, so whenever nay textbox got focused in any form you don't have to mention the form name, otherwise you may use public keyword for each textbox and access them from the main form, but I have no idea how it may work, coz I'm new in VB.
 
Back
Top