开发者

Textbox, delete button [c#]

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"开发者_Python百科 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 ^^


String text = Textbox.Text;
if(!String.IsNullOrEmpty(text))
    Textbox.Text = text.Substring(0,text.Length-1);


  TextBox.Text = TextBox.Text.Remove(str.Length - 1, 1);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜