Furthermore, because there's no guarantee that the input from the user can be successfully converted, depending on what somebody enters, you have to type try directly below the double x,y; declaration statement, as follows:
double x, y;// variables for reading input
try
You can put any stuff that is to be tried, but not guaranteed, to be successful within a try block.
Now enter the following between curly braces directly below try:
x = Convert.ToDouble(TextBox1.Text);
y = Convert.ToDouble(TextBox2.Text);