private void BtnTan_Click(object sender, EventArgs e) { //if there's input call the Third library and perform the tan function if (CheckForInput(tbResult.Text)) { //if tan returns true output returned value if (Trigonometry.DegreesTan(double.Parse(tbResult.Text), out double tan)) { tbResult.Text = tan.ToString(); isTotal = true; } //if tan returns false print error to user else { MessageBox.Show("Invalid input"); } } //if there's no input or input is invalid print error to user else { MessageBox.Show("Please enter valid input"); } }