By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,983 Members | 2,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,983 IT Pros & Developers. It's quick & easy.

On Screen KeyBoard

Ali Rizwan
100+
P: 927
Hello
I want to make something like virtual keyboard
if we press a button captioned A then A is inserted in a text file as the textfile is open . As we do in On screen Keyboard.
Thanx
Sep 4 '07 #1
Share this Question
Share on Google+
6 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Add A Command Button (cmdL) and make its property Index =0
and a TextBox on the Form
Check This :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.   Dim i As Integer
  3.   Dim TTop As Integer
  4.   TTop =300
  5.   cmdL(0).Left = 120
  6.   cmdL(0).Top =TTop
  7.   For i=1 To 26
  8.    Load cmdL(i)
  9.    With cmdL(i)
  10.       .Visible =True
  11.       .Enabled =True
  12.       .Left = cmdL(i-1).Left + cmdL(i-1).Width
  13.      .Top =TTop
  14.      .Caption = Chr(i+64)
  15.    End With
  16.    If i Mod 10 = 0 Then
  17.       TTop = TTop + 500
  18.       'Place Controls on Next Line
  19.    End If
  20.   Next
  21.   TTop =TTop + 500
  22.   Dim j As Integer
  23.   For j = 0 to 9
  24.    i=i+1
  25.    Load cmdL(i)
  26.    With cmdL(i)
  27.       .Visible =True
  28.       .Enabled =True
  29.       .Left = cmdL(i-1).Left + cmdL(i-1).Width
  30.      .Top =TTop
  31.      .Caption = j
  32.    End With
  33.  
  34.   Next
  35. End Sub
  36.  

Write this Code in cmdL KeyPress
Text1.Text =Text1.Text & cmdL(Index).Caption

Code Not Completely Tested, U can Refine it according to ur needs..


Regards
Veena
Sep 4 '07 #2

Expert 5K+
P: 8,434
I want to make something like virtual keyboard
Windows XP already comes with an onscreen keyboard. Why build your own?
Sep 6 '07 #3

Wagsy
P: 14
Ok sounds like what im after too. if say i have a numerical keypad 0-9, if i press 1 id like it to show in txtbox1, then if i press number 2 i'd like that to appear next to number 1 - 12. how is this possible, at the moment i use the :-

Private Sub Command7_Click()
Text2.Text = Command7.Caption
End Sub

when i press the next button it just overwrites?
Sep 6 '07 #4

Expert 5K+
P: 8,434
... when i press the next button it just overwrites?
You just need to concatenate the values. For example...
Text2.Text = Text2.Text & Command7.Caption
Sep 7 '07 #5

Wagsy
P: 14
Thanks Killer42... figured it now.
Sep 7 '07 #6

P: 1
Thank you vmuch it works for me...
Dec 26 '18 #7

Post your reply

Sign in to post your reply or Sign up for a free account.