public void CloseForm() { File.AppendAllText("e:\\debug.txt", string.Format("close: call. needOpenNum={0}\r\n", needOpenNum)); if (needOpenNum == 1) { try { waitFM.SetText("close"); waitThread.Abort(); waitThread = null; waitFM = null; } catch (Exception e) { e.Message.ToString(); } } needOpenNum--; File.AppendAllText("e:\\debug.txt", string.Format("close: end\r\n")); }
private void MainForm_Load(object sender, EventArgs e) { loadingForm = new LoadingForm(); this.Text = ConfDao.getInstance().Get(3).ToString(); resetNegativeItem(); NavigationUC navigation = new NavigationUC(this); navigation.Dock = DockStyle.Fill; this.panel1.Controls.Add(navigation); getWelcomeForm().Show(this.dockPanel1); this.toolStripStatusLabel1.Text = string.Format("{0}. 当前日期: {1}", ConfUtility.GetProductNameWithCopyRight(), DateTime.Now.ToShortDateString()); FormSingletonFactory.getInstance().MainForm = this; Control.CheckForIllegalCrossThreadCalls = false; if (ConfUtility.softType == 0) { this.toolStripButton_card.Visible = false; this.toolStripButton_consume.Visible = false; } else if (ConfUtility.softType == 1) { this.toolStripButton_purchase.Visible = false; this.toolStripButton_sell.Visible = false; this.toolStripButton_queryLib.Visible = false; this.toolStripButton_statistic.Visible = false; this.允许ToolStripMenuItem.Visible = false; this.单据设置ToolStripMenuItem.Visible = false; } }