Click here to Skip to main content
15,029,260 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
(Now it's not a question, just a solution)
hi!

I know how to make a new paragraph in a textBox(\r\n) but i want to know how to use <- (back space) in a textBox and
what's the code of it?

thanks

Solution:

You can get the length of the textBox the you should substring one less than length:

textBox1.text = textbox1.substring(0, textbox1.text.length - 1)

Good Luck

IMANVS :D oostl
Posted
Updated 22-Jan-12 5:45am
v3

1 solution

You can use keypress event to check this
C#
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) 
{     
if (e.KeyChar == 8) 
{         
  //backspace is used... add your logic here..
} 
} 
   

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