private void btnModaless_Click(object sender, EventArgs e) { MyDlg md = new MyDlg(); md.Owner = this; md.Show(); }
private void btnModal_Click(object sender, EventArgs e) { MyDlg md = new MyDlg(); DialogResult dResult = md.ShowDialog(); if (dResult == DialogResult.OK) { MessageBox.Show("OK"); } else if (dResult == DialogResult.Cancel) { MessageBox.Show("Cancle"); } }