private void btnDismiss_Click(object sender, System.EventArgs e) { //set the dialog results to OK this.DialogResult = DialogResult.No; //hide the dialog this.Hide(); }