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

Back Space textbox using Command_button

Wagsy
P: 14
Hello Again,
i have a virtual keypad 0-9, i can type in stuff

text1.text = text1.text & "2"

when i press a command button,

how do i use the back space chr$08 to remove the last number entered?

i.e. a delete button?
Sep 7 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 5K+
P: 8,434
... how do i use the back space chr$08 to remove the last number entered?
i.e. a delete button?
If it's definitely just the last digit, then simply remove the last character from the .Text property. For example...
Expand|Select|Wrap|Line Numbers
  1. text1.Text = Left(text1.Text, Len(text1.Text) - 1)
If you need to remove the last digit before the current insertion point (cursor) then it will be a bit more complex.
Sep 8 '07 #2

Wagsy
P: 14
thanks very much, i'll give it a whirl.
Sep 8 '07 #3

Robbie
100+
P: 180
If you need to remove the last digit before the current insertion point (cursor) then it will be a bit more complex.
Yep...

Expand|Select|Wrap|Line Numbers
  1. text1.Text = Mid(text1.Text, 1, text1.SelStart-1) + Mid(text1.Text, text1.SelStart + 1)
  2.  
;)
Sep 8 '07 #4

Wagsy
P: 14
Yep.... thanks for you time......
Sep 12 '07 #5

Post your reply

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