public BHMainForm() { InitializeComponent(); m_toolbox.Dock = DockStyle.Fill; ToolBoxpanelDock.Controls.Add(m_toolbox); //dotNetBarManager1.LoadLayout(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath),"config\\DockPanel.config")); cinTask = new CInTask(); cinTask.OnTaskStopFinished += new EventHandler <EventArgs>(cinTask_OnTaskStopFinished); panelDockContainer4.Controls.Add(cinTask); var frm = new SLogoForm(); if (frm.ShowDialog(this) == DialogResult.OK) { Show(); } else { Process p = Process.GetCurrentProcess(); p.Kill(); Application.Exit(); } }
public FJMainForm() { AppUtil apputil = new AppUtil(); this.Hide(); InitializeComponent(); m_toolbox.Dock = DockStyle.Fill; ToolBoxpanelDock.Controls.Add(m_toolbox); try { dotNetBarManager1.LoadLayout(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "config\\DockPanel.config")); } catch (Exception) {} var frm = new SLogoForm(); if (frm.ShowDialog(this) == DialogResult.OK) { try { cSortingTask = new CSortingTask(); cSortingTask.OnTaskStatusChanged += new EventHandler <EventArgs>(cSortingTask_OnTaskStatusChanged); cSortingTask.OnTaskStopFinished += new EventHandler <EventArgs>(cSortingTask_OnTaskStopFinished); cAbnSortingTask = new CAbnSortingTask(); CBox = new CBox(); CAbnBox = new CAbnBox(); CSortingMain = new C_SortingMain(); labout.Controls.Add(cSortingTask); panelDockContainer1.Controls.Add(cAbnSortingTask); panelDockContainer2.Controls.Add(CBox); panelDockContainer3.Controls.Add(CAbnBox); panelDockContainer4.Controls.Add(CSortingMain); this.cLog1 = new MonitorMain.CustomContorl.CLog(); this.OutPutpanelDock.Controls.Add(this.cLog1); this.cLog1.Dock = System.Windows.Forms.DockStyle.Fill; this.cLog1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cLog1.Location = new System.Drawing.Point(0, 0); this.cLog1.Name = "cLog1"; this.cLog1.Size = new System.Drawing.Size(1101, 133); this.cLog1.TabIndex = 0; } catch (Exception ex) { if (ex.Message.Contains("Unable to connect to any of the specified MySQL hosts")) { MessageBox.Show("无法连接到分拣机数据库"); } else { throw; } } Show(); } else { Process p = Process.GetCurrentProcess(); p.Kill(); Application.Exit(); } }