Virtual keyboard on a touch screen application

Heavenly

Well-known member
Joined
Aug 22, 2005
Messages
53
Location
Puerto Rico
Programming Experience
1-3
I have a virtual keyboard to help operators fill up Textboxes like the one shown below. This keyboard is called by clicking the GOLD colored buttons found in several forms within the application.

When the user is finished entering text on the keyboard and presses the button “Terminal” I need to place the typed Keyboards Text into the blue textbox found right below the Gold button that was clicked.

If Gold button3 in form1 was clicked then the Keyboard text must be entered in Textbox 3 belonging to this form1

If Gold button2 in form3 was clicked then the Keyboard text must be entered in Textbox 2 belonging to this form3

So on and so forth. I’m having problem figuring out the code needed to route this Keyboard text string into the correct textbox in the correct form.

Do you guys have any ideas on how to do this? I will appreciate all you comments and suggestions.

Thanks
 

Attachments

  • untitled.JPG
    untitled.JPG
    88.9 KB · Views: 97
This is pretty interesting stuff. I enjoy seeing something a little new and different like this.

Anyway, I would just pass a reference of the textbox when I open up the keyboard.

When you open the keyboard:
VB.NET:
Private Sub btnOne_Click(byval sender as Object, byval e as EventArgs) Handles btnOne.Click
   Dim kb as VirtualKeyboard = new VirtualKeyBoard(textbox1)
   kb.ShowDialog(Me)
End Sub

Then, you would need a constructor for that in your Keyboard Class:
VB.NET:
Private tb as TextBox
Public Sub New(ByVal t as TextBox)
   MyBase.New
   InitializeComponent()
   tb = t
   'Do Stuff
End Sub
Then, before you close your keyboard, change the text in the textbox with your variable:
VB.NET:
tb.Text = "Some Text"

Would that work for you?
 
Back
Top