void Editor_KeyDown(object sender, KeyEventArgs e) { StopTimer(); switch (e.KeyData) { case Keys.Enter: edit.PerformClick(edit.Properties.Buttons[0]); break; case (Keys.Control | Keys.Left): edit.PerformClick(edit.Properties.Buttons[1]); break; } }
private void detailView1_MouseDown(object sender, MouseEventArgs e) { if ((Control.ModifierKeys & Keys.Control) != Keys.Control) { GridView view = sender as GridView; GridHitInfo hi = view.CalcHitInfo(e.Location); if (hi.InRowCell) { if (hi.Column.RealColumnEdit.GetType() == typeof(RepositoryItemButtonEdit)) { view.FocusedRowHandle = hi.RowHandle; view.FocusedColumn = hi.Column; view.ShowEditor(); //force button click ButtonEdit edit = (view.ActiveEditor as ButtonEdit); Point p = view.GridControl.PointToScreen(e.Location); p = edit.PointToClient(p); EditHitInfo ehi = (edit.GetViewInfo() as ButtonEditViewInfo).CalcHitInfo(p); if (ehi.HitTest == EditHitTest.Button) { edit.PerformClick(ehi.HitObject as EditorButton); ((DevExpress.Utils.DXMouseEventArgs)e).Handled = true; } } } } }
private void TextBoxSerialNumber_Leave(object sender, EventArgs e) { ButtonSearch.PerformClick(); ReturnInfo getMeter = _meter.GetMeterBySerialNumber(new SmartDB(), TextBoxSerialNumber.Text); bool flag = getMeter.Code == ErrorEnum.NoError; if (flag) { ButtonEdit.PerformClick(); } }