private void dgvvibor_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 32) { int i = dgvvibor.CurrentRow.Index; switch (Sform.ownerFormName) { case "Pform": CallBackMy.callbackEventHandlerPform(dgvvibor.Rows[i].Cells["Kod"].Value.ToString()); break; case "Tform": CallBackMy.callbackEventHandlerTform(dgvvibor.Rows[i].Cells["Kod"].Value.ToString()); break; case "Pereocenkaform": CallBackMy.callbackEventHandlerPereocenkaform(dgvvibor.Rows[i].Cells["Kod"].Value.ToString()); break; case "Rform": CallBackMy.callbackEventHandlerRform(dgvvibor.Rows[i].Cells["Kod"].Value.ToString()); break; default: break; } this.Close(); } }
private void dgvFindT_KeyPress(object sender, KeyPressEventArgs e) { if (dgvFindT.RowCount > 0) { if (e.KeyChar == 32) { int irow = dgvFindT.CurrentRow.Index; switch (Sform.ownerFormName) { case "Pform": CallBackMy.callbackEventHandlerPform(dgvFindT.Rows[irow].Cells[0].Value.ToString()); exitfrm = "func"; this.Close(); break; case "Tform": CallBackMy.callbackEventHandlerTform(dgvFindT.Rows[irow].Cells[0].Value.ToString()); this.Close(); break; case "Pereocenkaform": CallBackMy.callbackEventHandlerPereocenkaform(dgvFindT.Rows[irow].Cells[0].Value.ToString()); exitfrm = "func"; this.Close(); break; case "Rform": CallBackMy.callbackEventHandlerRform(dgvFindT.Rows[irow].Cells[0].Value.ToString()); this.Close(); break; case "ReportMoveGoodsform": CallBackMy.callbackEventHandlerReportMoveGoodsform(dgvFindT.Rows[irow].Cells[0].Value.ToString(), dgvFindT.Rows[irow].Cells[1].Value.ToString()); break; default: break; } } } }