void ComNameKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { sEngine.AddCommissioner(InputTextBox("COMCODE").Text, InputTextBox("COMNAME").Text.ToUpper()); this.Close(); } else if (e.KeyCode == Keys.Escape) { InputTextBox("COMCODE").Focus(); } }