private void button1_Click(object sender, EventArgs e) { using (frmDialog d = new frmDialog()) { if (d.ShowDialog() == DialogResult.OK) { MessageBox.Show("OK Selected"); } else { MessageBox.Show("Cancel Selected"); } } }
private void button2_Click(object sender, EventArgs e) { frm = new frmDialog(); frm.Show(); }