开发者

How to make a textbox empty in code behind

I have a textbox (txtbox1) which has some value in it. I want to em开发者_如何学Pythonpty the value of textbox. Is that possible in code behind? If yes, how?

Thanks!


Well:

txtbox1.Text = "";

should do it.

(Note that I generally prefer "" to string.Empty in terms of readability. Use whichever you prefer. Ignore any talk about the performance differences between them - most articles I've seen on this are out of date, and any performance difference there might be will be entirely insignificant.)


txtbox1.Text = string.Empty;


use textbox1.Text = null; you can also use textBox1.Text = "";

if you want to put strings in the future textBox1.Text = string.Empty;

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜