Click here to Skip to main content
15,040,212 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai , anyone can inform to me what is code for button backspace.
currently i am create project Scientific calculator. In this project i need to prepare a button name for backspace. Oh , ya i am using VS 2005 ..
tq
Posted

Ascii of backspace is 08.

but for calculator you need to trim from right.

Say your handler for the button backspace is

C#
Private void backSpace_Click(object sender, EventArgs e)
{
string str=textBox.Text;
int len;
len=str.Length;
textBox.Text="";

textBox.Text= str.Substring(0, len - 1)

}


The textBox is the textbox where the numbers appears in the calculator.
   
Use e.Keys == Keys.Back in you event handler.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900