/// <summary> /// Converts the Temperature from C to F and K. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnConvertC_Click(object sender, EventArgs e) { if (Double.TryParse(txtCelsius.Text, out double grades)) { Celsius tempC = new Celsius(grades); txtCtoF.Text = ((Fahrenheit)tempC).GetAmount().ToString() + "°F"; txtCtoC.Text = tempC.GetAmount().ToString() + "°C"; txtCtoK.Text = ((Kelvin)tempC).GetAmount().ToString() + "°K"; } else { MessageBox.Show("Olvidaste colocar la temperatura a convertir!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }