Exemple #1
0
        private void NoiDungUserControl(string btnName)
        {
            foreach (UserControl uc in pnlNoiDung.Controls.OfType <UserControl>())
            {
                pnlNoiDung.Controls.Remove(uc);
            }
            ucPB      = new ucProgressBar();
            ucPB.Dock = DockStyle.Fill;
            pnlNoiDung.Controls.Add(ucPB);
            pnlNoiDung.Controls["ucProgressBar"].BringToFront();

            LoadUserControl();
            //Thread Load
            //threadLoadUserControl = new Thread(new ThreadStart(LoadUserControl));
            //threadLoadUserControl.Start();

            //Thread Load ProgressBar
            //DONE
            //threadLoadProgressBar = new Thread(new ThreadStart(LoadProgressBar));
            //threadLoadProgressBar.Start();
        }
Exemple #2
0
        private void backgroundWorkerHoSoNhanVien_DoWork(object sender, DoWorkEventArgs e)
        {
            pnlNoiDung.Invoke(new MethodInvoker(() => {
                ucPB      = new ucProgressBar();
                ucPB.Dock = DockStyle.Fill;
                foreach (UserControl uc in pnlNoiDung.Controls.OfType <UserControl>())
                {
                    pnlNoiDung.Controls.Remove(uc);
                }
                pnlNoiDung.Controls.Add(ucPB);
                pnlNoiDung.Controls["ucProgressBar"].BringToFront();
                ucPB.ProgressBar.Value = 90;

                ucHSNV      = new ucHoSoNhanVien();
                ucHSNV.Dock = DockStyle.Fill;

                ucPB.Invoke(new MethodInvoker(() => {
                    ucPB.ProgressBar.Value = 100;
                }));
            }));
        }