private void gridControl1_KeyDown_1(object sender, KeyEventArgs e)//Sự kiện Ctrl+A
        {
            switch (e.KeyCode)
            {
            //Event thời gian lên máy
            case Keys.F1:
                if (e.Control)
                {
                    if (TinhCongDoan == null || TinhCongDoan.IsDisposed)
                    {
                        frmTinhCongDoan.maDonHang = cbMaPSX.Text;
                        frmTinhCongDoan.soLuongSX = gridView1.GetFocusedRowCellDisplayText(Soluongsx_grid);
                        frmTinhCongDoan.maSanPham = txtMasp.Text;
                        frmTinhCongDoan.donHangID = txtDonHangID.Text;
                        frmTinhCongDoan.keHoachID = txtKeHoachID.Text;

                        string Gol = "";
                        Gol = gridView1.GetFocusedDisplayText();
                        frmTinhCongDoan.sanPham = gridView1.GetFocusedRowCellDisplayText(tensp_grid);
                        TinhCongDoan            = new frmTinhCongDoan();
                        TinhCongDoan.Show();
                        //frmTinhCongDoan.ActiveForm.TopMost = true;
                    }
                }
                break;

            //Event call Tien do vat tu
            case Keys.F2:
                if (TienDoVatTu == null || TienDoVatTu.IsDisposed)
                {
                    //frmPrVatTu.maSanPham = txtMasp.Text;
                    TienDoVatTu = new frmPrVatTu();
                    TienDoVatTu.Show();
                    frmPrVatTu.ActiveForm.TopMost = true;
                }
                break;
            }
            //switch (e.KeyCode)
            //{
            //    //event call Tien do vat tu
            //    case Keys.F2:
            //        if (TienDoVatTu == null || TienDoVatTu.IsDisposed)
            //        {
            //            //frmPrVatTu.maSanPham = txtMasp.Text;
            //            TienDoVatTu = new frmPrVatTu();
            //            TienDoVatTu.Show();
            //            frmPrVatTu.ActiveForm.TopMost = true;
            //        }
            //        break;
            //}
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            frmTinhCongDoan tinhcongdoan = new frmTinhCongDoan();

            tinhcongdoan.Show();
        }