Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows;
- using System.Windows.Controls;
- namespace WhateverProgram
- {
- public partial class UnaVentana : Window
- {
- int _retVal;
- public int GetValue()
- {
- ShowDialog();
- return _retVal;
- // O, en caso de que sea cancelable...
- return (ShowDialog() ?? false) ? _retval : 0;
- }
- private void BtnOk_Click(object sender, EventArgs e)
- {
- // Digamos que, al hacer clic en OK, se devuelve un valor...
- _retVal = 1234;
- DialogResult = true;
- Close();
- }
- }
- }
Add Comment
Please, Sign In to add comment