日期:2014-05-17 浏览次数:20905 次
public partial class InputBox : Form
{
private string m_input;
public InputBox(string title, string description, ref string input)
{
InitializeComponent();
this.Text = title;
this.label.Text = description;
this.btnOK.Enabled = false;
m_input = input;
}
private void textBox_TextChanged(object sender, EventArgs e)
{
btnOK.Enabled = (textBox.Text != "");
}
private void btnOK_Click(object sender, EventArgs e)
{
m_input = textBox.Text;
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}