Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello
I need code for back space by c# language
Posted
Updated 22-Jul-11 7:51am
v2
Comments
Sergey Alexandrovich Kryukov 3-Jul-11 16:20pm    
1) Not a question, 2) statement makes no sense.
--SA
Christian Graus 3-Jul-11 17:05pm    
Where do you want a backspace ? What framework are you using ? If you don't answer these questions, you've not asked a question, nothing you've said points to a single clear answer.

Key.Back[^]

Next time elaborate on your question and actually describe what it is you want.
 
Share this answer
 
FOR the current active window.

SendKeys.Send("{BACKSPACE}");
 
Share this answer
 
Comments
Christian Graus 3-Jul-11 21:19pm    
This is a hideous thing to do, you should almost never do it.
Dave Kreskowiak 22-Jul-11 13:52pm    
To be fair, so was the question.
:)
[no name] 4-Jul-11 8:23am    
This is a VB abomination. The OP asked for C#
You can use an escaped character:

string backspace = "\b";


Alex
 
Share this answer
 
//This code will help the button to work as a backspace button. On the button _click event write the following code.

int index = richTextBox1.SelectionStart;
richTextBox1.Text = richTextBox1.Text.Remove(richTextBox1.SelectionStart - 1, 1);
richTextBox1.Select(index - 1, 1);
richTextBox1.Focus();

//This has worked for me.
 
Share this answer
 

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