Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement