public Preview(VideoProcess vp) { InitializeComponent(); videoProcess = vp; //this.Visible = false; }
private void resetToolStripButton_Click(object sender, EventArgs e) { try { vp.p.Close(); vp.closeVideoSource(); vp = new VideoProcess(); vp.connectCamere(); vp.p.Visible = false; if (vp.isConnected == true) { //MessageBox.Show("Target device has been reconnected successfully."); targetDeviceLabel.ForeColor = Color.Blue; targetDeviceLabel.BackColor = Color.Green; } else { targetDeviceLabel.ForeColor = Color.White; targetDeviceLabel.BackColor = Color.Red; } serialPort.openPort(); if (serialPort.isPortConnected == true) { //MessageBox.Show("Shooting device has been reconnected."); shootingDeviceLabel.ForeColor = Color.Blue; shootingDeviceLabel.BackColor = Color.Green; } else { shootingDeviceLabel.ForeColor = Color.White; shootingDeviceLabel.BackColor = Color.Red; } } catch (Exception exp) { MessageBox.Show("Error occured,Please restart the application."); } }
//GraphForm graphForm; public MainForm() { InitializeComponent(); this.FormClosing += new FormClosingEventHandler(this.MainForm_FormClosingExit); oneButton.Visible = false; twoButton.Visible = false; threeButton.Visible = false; fourButton.Visible = false; fiveButton.Visible = false; sixButton.Visible = false; sevenButton.Visible = false; eightButton.Visible = false; nineButton.Visible = false; //For loading screen this.Hide(); vp = new VideoProcess(); vp.connectCamere(); vp.p.Visible = false; targetTimer.isRunning = false; splashThread = new Thread(new ThreadStart(Loading.ShowLoadingScreen)); splashThread.IsBackground = true; Fullscreen(false); loadAllClasses(); serialPort = new SerialPortComm(vp, mainTargetBox, mainTargetInfo, this, targetTimer); splashThread.Start(); mainTargetBox.setTargetInfo(mainTargetInfo); showLoadingInfo(); mainTargetInfo.setShotLabelInfo(0, 0); this.WindowState = FormWindowState.Maximized; SetMenuItem(0); }