Command_button to textbox $ or input?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wagsy
    New Member
    • Apr 2007
    • 14

    Command_button to textbox $ or input?

    Hi All,
    I have a virtual keypad - say 0-9, when i press the buttons i want the sequence of keypresses to appear in a textbox. at the moment when i type them in they just overwrite each other. i want them to step along similar to a calculator?
    any ideas - currently i use:

    (its on another pc so im guessing here)!

    command1_click
    text1.textbox.c aption
    end sub

    anyway that bit work where it goes into the text box but like i say the first chR$ just overwrites as i choose a different key!!!
  • YarrOfDoom
    Recognized Expert Top Contributor
    • Aug 2007
    • 1243

    #2
    Well here's something you can try for the part with the buttons:

    Code:
    Sub Button1_Click()
    TextBox1.Text = TextBox1.Text + "1"
    End Sub
     
    Sub Button2_Click()
    TextBox2.Text = TextBox2 + "2"
    End Sub
     
    And so on...
    Yarr Of Doom
    Last edited by YarrOfDoom; Sep 6 '07, 08:28 PM. Reason: little spelling error

    Comment

    • kadghar
      Recognized Expert Top Contributor
      • Apr 2007
      • 1302

      #3
      Originally posted by yarrofdoom
      Well here's something you can try for the part with the buttons:

      Code:
      Sub Button1_Click()
      TextBox1.Text = TextBox1.Text + "1"
      End Sub
       
      Sub Button2_Click()
      TextBox2.Text = TextBox2 + "2"
      End Sub
       
      And so on...
      Yarr Of Doom
      i'd recomend you to use & instead of +, just to prevent mistakes when you are working with numberic values.

      Comment

      • Wagsy
        New Member
        • Apr 2007
        • 14

        #4
        Thanks a lot, i did this and it works fine

        Private Sub Command10_Click ()
        Text2.Text = Text2.Text & "4"
        End Sub

        Comment

        Working...