|
-
Nov 29th, 2010, 05:21 AM
#1
Thread Starter
New Member
Backspace button.
Hi.
I am making a calculator.
I need a button that functions like a Backspace-button on a calculator. Erase the last inserted char, or what ever may work.
I use:
Button1
TextBox1
Thanks.
-
Nov 29th, 2010, 08:09 AM
#2
Re: Backspace button.
On hitting the button , rewrite the string with all charcters except length - 1 character.
-
Nov 29th, 2010, 08:37 AM
#3
Re: Backspace button.
TextBox1.Text = TextBox1.Text.Substring(0,TextBox1.Text.Length-1)
-
Nov 29th, 2010, 09:01 AM
#4
Re: Backspace button.
be sure to check the length of the text property first, if there's only 1 char than set the text equal to "0" instead of removing the char.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|