private void btnCancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; if (this.cameraViewTest.IsRunning()) { this.cameraViewTest.Stop(); } this.Camera.PlugIns.ReleaseAll(); this.Close(); }