Windows Forms, make a text box string variable public?

Just playing about with Windows Forms for the first time after writing a fair bit of console code. I know how to store strings from text box's but my question is how would I make the string rb available to use in my source.cpp

1
2
3
4
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
			String ^ rb = textBox6 -> Text;
			textBox1 -> Text = rb; // just playing around 
		 }


The above code is on button click. My next question is how do I run my source from buttonclick do I just call my main function within the button code above? Essentially I want the user to enter a string, the string is stored then my cpp file will handle all the playing around with it , and then eventually output something to a different textbox on the form.
On second thought, do I actually just put all my main function code inside the button and make the button public instead of private? if thats the case what do I do with function calls?

(I wrote a fully working text based program in console and I a trying to write it with a UI now)
Topic archived. No new replies allowed.