Example #1
0
 /// <summary>
 /// Form key down For quick access
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmSalesInvoice_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Escape)
         {
             btnClose_Click(sender, e);
         }
         if (e.KeyCode == Keys.S && Control.ModifierKeys == Keys.Control)
         {
             btnSave_Click(sender, e);
         }
         if (e.KeyCode == Keys.D && Control.ModifierKeys == Keys.Control)
         {
             if (btnDelete.Enabled)
             {
                 btnDelete_Click(sender, e);
             }
         }
         if (e.KeyCode == Keys.C && Control.ModifierKeys == Keys.Alt)
         {
             if (dgvSalesInvoice.CurrentCell != null)
             {
                 if (dgvSalesInvoice.CurrentCell == dgvSalesInvoice.CurrentRow.Cells["dgvtxtSalesInvoiceProductName"] || dgvSalesInvoice.CurrentCell == dgvSalesInvoice.CurrentRow.Cells["dgvtxtSalesInvoiceProductCode"])
                 {
                     SendKeys.Send("{F10}");
                     if (dgvSalesInvoice.Columns[dgvSalesInvoice.CurrentCell.ColumnIndex].Name == "dgvtxtSalesInvoiceProductName" || dgvSalesInvoice.Columns[dgvSalesInvoice.CurrentCell.ColumnIndex].Name == "dgvtxtSalesInvoiceProductCode")
                     {
                         frmProductCreation frmProductCreationObj = new frmProductCreation();
                         frmProductCreationObj.MdiParent = formMDI.MDIObj;
                         frmProductCreationObj.CallFromDSalesInvoice(this);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI: 132" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }