Defining a variable from textbox input in VC++

Basically, I am making a simple windows form application in C++ that calculates the area and circumference of a circle, by using the radius input by the user in a textbox. When the user presses the 'Calculate' button it runs the calculation. The problem I'm having is, I'm unsure how to make the program read the radius from the content of the textbox. Here's what I have so far.
1
2
3
4
5
6
7
8
9
10
11
12
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

			

			 double radius;
			 double circumference;
			 double area;
			 const double pi = 3.14159265;
			 radius = textBox1->Text;

			 area = radius * radius * pi;
			 circumference = radius * 2.0 * pi;		
radius = Double::Parse( textBox1->Text );
http://msdn.microsoft.com/en-us/library/fd84bdyt.aspx

Note: This one doesn't do any error handling of something un-double-like is written in the text box.
You want radius to be stored as a number, so try:

radius = Convert::ToDouble(textBox1->Text)
Topic archived. No new replies allowed.