private void mnuInsert_Click(object sender, EventArgs e) { if (Flag == 1) { frmProduct f = new frmProduct(); f.op = "Add"; f.Flag = 0; f.Form_Load(); try { f.cmbType.Text = trvProduct.SelectedNode.Text; } catch { } f.ShowDialog(); } else { frmProduct f = new frmProduct(); f.op = "Add"; f.Flag = 0; f.Form_Load(); f.ShowDialog(); } }
private void mnuInsert_Click(object sender, EventArgs e) { try { frmProduct f = new frmProduct(); f.op = "Add"; f.Flag = 0; f.Form_Load(); f.ShowDialog(); } catch { } }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Enter) { try { if (dgvStore.CurrentCell.ColumnIndex == 0) { Get_Product(); Calculate_INC(); Calculate_DEC(); } if (dgvStore.CurrentCell.ColumnIndex == 2 || dgvStore.CurrentCell.ColumnIndex == 3) { Inc_OR_Dec(); Calculate_INC(); Calculate_DEC(); } SendKeys.Send("{tab}"); return(true); } catch { } } if (keyData == Keys.Delete) { mnuDelete_Click(null, null); Calculate_INC(); Calculate_DEC(); } if (this.ActiveControl.GetType() != typeof(DevComponents.DotNetBar.Controls.ComboBoxEx)) { if (keyData == Keys.F12) { try { frmProduct f = new frmProduct(); f.op = "Add"; f.Flag = 0; f.Form_Load(); f.ShowDialog(); } catch { } } } return(base.ProcessCmdKey(ref msg, keyData)); }
private void cmbProduct_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == 13) { dgvStore.Focus(); } else if (e.KeyData == Keys.F12) { try { frmProduct f = new frmProduct(); f.op = "Add"; f.Flag = 0; f.Form_Load(); f.ShowDialog(); Fill_Product(); } catch { } } }