private void MainForm_Load(object sender, EventArgs e) { try { MyConfig.LoadConfig("xxx"); SplashFrm.num = 10; Global.InitHTuple(); //初始化检查球直径的阈值参数 Global.MNum = mySoftReg.GetMNum(); Global.TimeLeft = mytestReg.TimeLeft(); if (Global.TimeLeft > 100) { Global.IsRegister = true; } else { Global.IsRegister = false; } //MyConfig.LoadData(); videofrm = new VideoFrm(this); SplashFrm.num = 50; // Thread.Sleep(1000); settingfrm = new SettingFrm(this); iofrm = new IOFrm(this); SplashFrm.num = 99; Thread.Sleep(200); SplashFrm.num = 100; this.Visible = true; videofrm.MdiParent = this; videofrm.Dock = DockStyle.Fill; videofrm.Show(); videofrm.Activate(); this.WindowState = FormWindowState.Maximized; //InitIOCard(); //初始化IO卡 //MyInit(); //初始化各个线程 //myLS.init(); //初始化相机 myLS.ImageGrabbed += MyLS_ImageGrabbed; } catch (Exception eee) { MessageBox.Show(eee.ToString()); } Opacity = 100; }
private void button3_Click(object sender, EventArgs e) { try { MyConfig.LoadConfig("//" + listBox1.SelectedItem.ToString()); showTextBox(); } catch (Exception eee) { MessageBox.Show("检查是否选择列表位置"); MessageBox.Show(eee.ToString()); } }
private void button1_Click(object sender, EventArgs e) { try { MyConfig.LoadConfig("//" + listBox1.SelectedItem.ToString()); pName = listBox1.SelectedItem.ToString(); DialogResult = DialogResult.OK; } catch (Exception eee) { MessageBox.Show("检查是否选择列表位置"); MessageBox.Show(eee.ToString()); } }