How does one read a textbox into a string and use the string for something else?

simpleonline

Active member
Joined
Sep 13, 2011
Messages
33
Programming Experience
Beginner
I have two text boxes on my form. Textbox1 and Textbox2. Textbox1 will contain information. I want to code my button to read textbox 1 and put it into a string or some way for the app to read the textbox and store the information into it's memory.

Then I want to be able to read that string into the second part of my application.

Not sure where to go with this. Should I:

a). read the textbox into a string using a streamreader and then use a streamwriter to write the data into a string?

b). save the textbox to a .txt file then use the openfiledialog to read the text file into a string to use?

Any help guys would be much appreciated. Thanks
 
Nope.

To access the contents of Textbox1, refer to Textbox1.text
For example, to set a string TBS to the contents of Textbox1 and then display it in a messagebox,

VB.NET:
Dim TBS as string
TBS = Textbox1.text
Messagebox.show(TBS)


I'm intrigued that you're apparently fluent in programming vocabulary, but don't know how to do this. May I ask what your programming experience is?
 
Back
Top