0

to add new letter to textbox i use

Textbox.Text = Textbox.Text + " ";

adds space etc., its simple

but i didnt figured out how can i delete last line

for examp.

text of textbox is abcdefg

and when user clicks delete, text is "abcdef" then "adcde" etc.

how can i do this ?

i tried to search the web but i failed because i dont know how to search that such a thing ^^

2 Answers 2

4
String text = Textbox.Text;
if(!String.IsNullOrEmpty(text))
    Textbox.Text = text.Substring(0,text.Length-1);
3
  • Hello, i get 'string' does not contain a definition for 'isNullOrEmpty error. what to do ?
    – user646317
    Mar 6, 2011 at 0:03
  • Türkiyeden olduğunu gördüm bir de Türkçe yazim dedim, şimdi googleda aradım biraz bu fonksiyon mu desem artık neyse kendim yazabileceğim gördüm ama net 3.0 ve üstünde zaten varmış ? program net 4.0 kullanıyor sorun nerde anlamadım.
    – user646317
    Mar 6, 2011 at 0:19
  • oh i just noticed its not isnullor.. its Is... whatever, thanks.
    – user646317
    Mar 6, 2011 at 1:22
1
  TextBox.Text = TextBox.Text.Remove(str.Length - 1, 1);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.