Guest User

Untitled

a guest
Feb 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. namespace WhateverProgram
  5. {
  6. public partial class UnaVentana : Window
  7. {
  8. int _retVal;
  9.  
  10. public int GetValue()
  11. {
  12. ShowDialog();
  13. return _retVal;
  14.  
  15. // O, en caso de que sea cancelable...
  16. return (ShowDialog() ?? false) ? _retval : 0;
  17. }
  18.  
  19. private void BtnOk_Click(object sender, EventArgs e)
  20. {
  21. // Digamos que, al hacer clic en OK, se devuelve un valor...
  22. _retVal = 1234;
  23. DialogResult = true;
  24. Close();
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment