Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public void ShowMyDialogBox()
  2. {
  3. Form2 testDialog = new Form2();
  4.  
  5. // Show testDialog as a modal dialog and determine if DialogResult = OK.
  6. if (testDialog.ShowDialog(this) == DialogResult.OK)
  7. {
  8. // Read the contents of testDialog's TextBox.
  9. this.txtResult.Text = testDialog.TextBox1.Text;
  10. }
  11. else
  12. {
  13. this.txtResult.Text = "Cancelled";
  14. }
  15. testDialog.Dispose();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement