using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Estsh.Client { public partial class FrmInputBoxRework : Form { private string _input = string.Empty; public string Input { get { return _input; } } public FrmInputBoxRework() { InitializeComponent(); } private void FrmInputBoxRework_Load(object sender, EventArgs e) { txtInput .Focus (); } private void txtPassword_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { if (string.IsNullOrEmpty(txtInput.Text)) { this.DialogResult = DialogResult.No; } else { _input = txtInput.Text; this.DialogResult = DialogResult.OK; } } } private void FrmInputBoxRework_Activated(object sender, EventArgs e) { txtInput.Focus(); } } }