public void ShowMyDialogBox() { Form2 testDialog = new Form2(); // Show testDialog as a modal dialog and determine if DialogResult = OK. if (testDialog.ShowDialog(this) == DialogResult.OK) { // Read the contents of testDialog's TextBox. this.txtResult.Text = testDialog.TextBox1.Text; } else { this.txtResult.Text = "Cancelled"; } testDialog.Dispose(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)