private void MainForm_Load(object sender, EventArgs e) { Thread.Sleep(100); Process.Toolhelp.KillProcess("POS.exe"); //关闭主程序 dlgShowmsg = showMessage; dlgCloseForm = closeFm; Thread th = new Thread(UpdatePos); th.IsBackground = true; th.Start(); }
public FrmSettle() { InitializeComponent(); this.Width = 530; this.Height = 330; this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2); if (frmWait == null) { frmWait = new FrmWait(""); } //初始化委托 dlgShowWaitMsg = new DlgShowMsg(ShowWaitMsg); dlgHideWaitMsg = new DlgHideMsg(HideWaitMsg); dlgShowErrorMsgBox = new DlgShowMsg(ShowErrorMsgBox); dlgShowInfoMsgBox = new DlgShowMsg(ShowInfoMsgBox); dlgCloseForm = new DlgCloseForm(CloseForm); //初始化线程 readThread = new Thread(new ThreadStart(ReadCard)); readThread.IsBackground = true; readThread.Start(); }