private void captureAll(Keys key) { switch (key) { case Keys.F1: penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm(); displayHelp.ShowDialog(this); break; case Keys.F2: ReturDtPicker_1.Focus(); barcodeForm displayBarcodeForm = new barcodeForm(this, globalConstants.RETUR_PEMBELIAN); displayBarcodeForm.Top = this.Top + 5; displayBarcodeForm.Left = this.Left + 5; //(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2); displayBarcodeForm.ShowDialog(this); break; case Keys.F8: //detailReturDataGridView.Focus(); addNewRow(); break; case Keys.F9: saveAndPrintButton.PerformClick(); break; case Keys.F11: ReturDtPicker_1.Focus(); dataProdukForm displayProdukForm = new dataProdukForm(originModuleID, this); displayProdukForm.ShowDialog(this); break; } }
private void captureAll(Keys key) { int rowcount = 0; switch (key) { case Keys.F1: penerimaanBarangHelpForm displayHelp = new penerimaanBarangHelpForm(); displayHelp.ShowDialog(this); break; case Keys.F2: ReturDtPicker_1.Focus(); if (null == displayBarcodeForm || displayBarcodeForm.IsDisposed) { displayBarcodeForm = new barcodeForm(this, globalConstants.RETUR_PEMBELIAN); displayBarcodeForm.Top = this.Top + 5; displayBarcodeForm.Left = this.Left + 5; //(Screen.PrimaryScreen.Bounds.Width / 2) - (displayBarcodeForm.Width / 2); } displayBarcodeForm.Show(); displayBarcodeForm.WindowState = FormWindowState.Normal; //detailReturDataGridView.Focus(); break; case Keys.F8: //detailReturDataGridView.Focus(); rowcount = detailReturDataGridView.RowCount; detailReturDataGridView.CurrentCell = detailReturDataGridView.Rows[rowcount - 1].Cells["productID"]; //addNewRow(); break; case Keys.F9: saveAndPrintButton.PerformClick(); break; case Keys.F11: ReturDtPicker_1.Focus(); if (null == browseProdukForm || browseProdukForm.IsDisposed) { browseProdukForm = new dataProdukForm(originModuleID, this); } browseProdukForm.Show(); browseProdukForm.WindowState = FormWindowState.Normal; //detailReturDataGridView.Focus(); break; case Keys.Delete: if (detailReturDataGridView.ReadOnly == false) { if (DialogResult.Yes == MessageBox.Show("DELETE CURRENT ROW?", "WARNING", MessageBoxButtons.YesNo)) { deleteCurrentRow(); calculateTotal(); } } break; } }