On Screen KeyBoard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    On Screen KeyBoard

    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
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

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

    [code=vb]
    Private Sub Form_Load()
    Dim i As Integer
    Dim TTop As Integer
    TTop =300
    cmdL(0).Left = 120
    cmdL(0).Top =TTop
    For i=1 To 26
    Load cmdL(i)
    With cmdL(i)
    .Visible =True
    .Enabled =True
    .Left = cmdL(i-1).Left + cmdL(i-1).Width
    .Top =TTop
    .Caption = Chr(i+64)
    End With
    If i Mod 10 = 0 Then
    TTop = TTop + 500
    'Place Controls on Next Line
    End If
    Next
    TTop =TTop + 500
    Dim j As Integer
    For j = 0 to 9
    i=i+1
    Load cmdL(i)
    With cmdL(i)
    .Visible =True
    .Enabled =True
    .Left = cmdL(i-1).Left + cmdL(i-1).Width
    .Top =TTop
    .Caption = j
    End With

    Next
    End Sub
    [/code]


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

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


    Regards
    Veena

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by Ali Rizwan
      I want to make something like virtual keyboard
      Windows XP already comes with an onscreen keyboard. Why build your own?

      Comment

      • Wagsy
        New Member
        • Apr 2007
        • 14

        #4
        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.Captio n
        End Sub

        when i press the next button it just overwrites?

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by Wagsy
          ... when i press the next button it just overwrites?
          You just need to concatenate the values. For example...
          Text2.Text = Text2.Text & Command7.Captio n

          Comment

          • Wagsy
            New Member
            • Apr 2007
            • 14

            #6
            Thanks Killer42... figured it now.

            Comment

            • loy1234
              New Member
              • Dec 2018
              • 1

              #7
              Thank you vmuch it works for me...

              Comment

              Working...