num1 and num2 are text boxes. you need to extract the text from the text boxes and convert to a double before you can compute any kind of result.