32 lines
787 B
C#
32 lines
787 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
|
|
namespace JD.Winforms.CommonDialogs
|
|
{
|
|
public partial class NameEntryDlg : Form
|
|
{
|
|
public NameEntryDlg()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public string NameEntry
|
|
{
|
|
get { return StateNameEdit.Text; }
|
|
set { StateNameEdit.Text = value; }
|
|
}
|
|
|
|
public void SetTitle( String _title ) { Text = _title; }
|
|
public void SetLabel( String _label) { label1.Text = _label; }
|
|
|
|
private void StateNameEdit_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
{
|
|
this.DialogResult = DialogResult.OK;
|
|
Close();
|
|
}
|
|
}
|
|
}
|
|
}
|