private void textBoxIcao_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == Convert.ToChar(Keys.Enter)) { SubmitButton.PerformClick(); } }
private void PassTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { SubmitButton.PerformClick(); } }
/// <summary> /// 完成初始化 /// </summary> protected virtual void PostInitialize() { if (ProgramConfiguration.Instance.OrderDlgCenterMainform) { UiUtility.PlaceFormAtCenter(this, show: false); } else { StartPosition = FormStartPosition.CenterScreen; } FormPlacementManager.Instance.Control(this); Layer = new MsgLayer(); Controls.Add(Layer); Layer.BringToFront(); //空格键快速提交 KeyDown += (s, e) => { if (SubmitButton?.Enabled == true && !InQueue) { if (e.KeyCode == Keys.Space || e.KeyCode == Keys.Enter) { SubmitButton.PerformClick(); e.Handled = true; } } }; KeyPreview = true; }
public PasswordRecovery() { InitializeComponent(); FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; EmailTextbox.KeyDown += (sender, args) => { if (args.KeyCode == Keys.Return) { SubmitButton.PerformClick(); } }; }
public Activation_Stage2(string email, string paymentType) { InitializeComponent(); CodeTextbox.KeyDown += (sender, args) => { if (args.KeyCode == Keys.Return) { SubmitButton.PerformClick(); } }; m_Email = email; m_PaymentType = paymentType; }
public Activation_Stage1(string paymentType) { InitializeComponent(); //FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; EmailTextbox.KeyDown += (sender, args) => { if (args.KeyCode == Keys.Return) { SubmitButton.PerformClick(); } }; m_paymentType = paymentType; }