private void txtValue_TextChanged(object sender, System.EventArgs e) { //Prevent user entering no numeric value if querying numeric field if (optNumber.Checked==true) { if (IsDecimal(txtValue.Text) == false) { txtValue.Clear(); } } } }