private void BtnCos_Click(object sender, EventArgs e) { //if there's input call the Third library and perform the cos function if (CheckForInput(tbResult.Text)) { tbResult.Text = Trigonometry.DegreesCos(double.Parse(tbResult.Text)).ToString(); isTotal = true; } //if there's no input or input is invalid print error to user else { MessageBox.Show("Please enter valid input"); } }