public frmUserList() { frmWait frmWait = new frmWait(); Thread splashThread = new Thread(new ThreadStart( () => { frmWait.ShowDialog(); }));//Application.Run(frmWait); splashThread.SetApartmentState(ApartmentState.MTA); splashThread.Start(); InitializeComponent(); RetrieveData(); splashThread.Abort(); }
private void btnSignin_Click(object sender, EventArgs e) { frmWait frmWait = new frmWait(); Thread cl = new Thread(new ThreadStart( () => { frmWait.captionLoad("¡ÓÅѧµÃǨÊͺ..."); frmWait.ShowDialog(); } )); cl.Start(); if (authentication.checkUser(txtUsername.Text, txtPassword.Text)) { cl.Abort(); this.Hide(); } else { cl.Abort(); this.Activate(); MessageBoxAdv.Show("ª×èͼÙéãªéËÃ×ÍÃËÑʼèÒ¹äÁè¶Ù¡µéͧ ¡ÃسҷÓÃÒ¡ÒÃãËÁèÍÕ¡¤ÃÑé§", "ÃÒ§ҹ¤ÇÒÁ¼Ô´¾ÅÒ´", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }