public EditingEmployeeForm() { InitializeComponent(); B_DeleteUser.Click += B_DeleteUser_Click; TSB_Censel.Click += (s, e) => Close(); LL_Post.Click += (s, e) => SelectionPost?.Invoke(); TSB_Save.Click += async(s, e) => await Save?.Invoke(); Load += EditingEmployeeForm_Load; }
private void EditingEmployeeForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.Control && e.KeyCode == Keys.Enter) { SelectionPost?.Invoke(); } else if (e.KeyCode == Keys.Enter) { TSB_Save.PerformClick(); } else if (e.KeyCode == Keys.Escape) { Close(); } }