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

Command_button to textbox $ or input?

Wagsy
P: 14
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.caption
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!!!
Sep 6 '07 #1
Share this Question
Share on Google+
3 Replies


YarrOfDoom
Expert 100+
P: 1,247
Well here's something you can try for the part with the buttons:

Expand|Select|Wrap|Line Numbers
  1. Sub Button1_Click()
  2. TextBox1.Text = TextBox1.Text + "1"
  3. End Sub
  4.  
  5. Sub Button2_Click()
  6. TextBox2.Text = TextBox2 + "2"
  7. End Sub
  8.  
  9. And so on...
  10.  
Yarr Of Doom
Sep 6 '07 #2

kadghar
Expert 100+
P: 1,295
Well here's something you can try for the part with the buttons:

Expand|Select|Wrap|Line Numbers
  1. Sub Button1_Click()
  2. TextBox1.Text = TextBox1.Text + "1"
  3. End Sub
  4.  
  5. Sub Button2_Click()
  6. TextBox2.Text = TextBox2 + "2"
  7. End Sub
  8.  
  9. And so on...
  10.  
Yarr Of Doom
i'd recomend you to use & instead of +, just to prevent mistakes when you are working with numberic values.
Sep 6 '07 #3

Wagsy
P: 14
Thanks a lot, i did this and it works fine

Private Sub Command10_Click()
Text2.Text = Text2.Text & "4"
End Sub
Sep 7 '07 #4

Post your reply

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