开发者

How to display data inside a textbox?

My question is that I have extracted data from a file and pushed into a string variable.

I have a FORM created in visual studio having a text box, so I want to display that extracted data in textbox created.

How ca开发者_开发问答n achieve this?


You can do it like this:

yourTextBox.Text = yourString;


For a TextBox, it is just

myTextBox.Text = myStringVariable;

But if the data is large, you may want to consider the RichTextBox control instead.

This is all assuming you're using Windows Forms...


string strName="someone";
TextBox1.Text=strName;

If you trim the data to remove the unwanted trailing spaces if there is any.

TextBox1.Text=strName.Trim();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜