August 2017
Beginner
566 pages
12h 34m
English
Beneath comment 12, you'll add the following line:
double value = Convert.ToDouble(TextBox1.Text);
Notice the class called Convert. If you hover your mouse over Convert, it says Converts a base data type to another base data type. So, basically this is a nice class: a collection of functionality that we can use to convert between different data types.
Now, in our particular case, we say Convert.ToDouble, and specifically we'll take the input from the box; so we finish with TextBox1.Text.
Remember that this line will read from the TextBox control, and the value will be converted to a double data type and then saved over to the variable named value. So, all of that will happen within that single line.
Read now
Unlock full access