Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. private void LeaveFromField(object sender, EventArgs e)
  2. {
  3.  
  4. var item = (TabPage)sender;
  5. DialogResult result = MessageBox.Show(
  6. null,
  7. "Внимание",
  8. MessageBoxButtons.YesNo,
  9. MessageBoxIcon.Information);
  10. if (result == DialogResult.No)
  11. {
  12. //
  13. }
  14.  
  15. }
  16.  
  17. private void SelectTab(object sender, TabControlCancelEventArgs e)
  18. {
  19. DialogResult result = MessageBox.Show
  20. (
  21. "Выйти?",
  22. "Внимание",
  23. MessageBoxButtons.YesNo,
  24. MessageBoxIcon.Error
  25. );
  26. if (result == DialogResult.No)
  27. {
  28. e.Cancel = true;
  29. }
  30. if (result == DialogResult.Yes)
  31. {
  32. Clear();
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement