private void frmSpectrumAnalyser_Disposed(object sender, EventArgs e) { frmSpectrumAnalyser = null; }
private void spectrumAnalyserToolStripMenuItem_Click(object sender, EventArgs e) { if (spectrumAnalyserToolStripMenuItem.Checked) { if (frmSpectrumAnalyser != null) frmSpectrumAnalyser.Close(); spectrumAnalyserToolStripMenuItem.Checked = false; } else { if (frmRssiAnalyser != null) frmRssiAnalyser.Close(); if (frmSpectrumAnalyser == null) { frmSpectrumAnalyser = new SpectrumAnalyserForm(); frmSpectrumAnalyser.FormClosed += new FormClosedEventHandler(frmSpectrumAnalyser_FormClosed); frmSpectrumAnalyser.Disposed += new EventHandler(frmSpectrumAnalyser_Disposed); frmSpectrumAnalyser.SX1231 = sx1231; frmSpectrumAnalyser.AppSettings = appSettings; } frmSpectrumAnalyser.Show(); spectrumAnalyserToolStripMenuItem.Checked = true; } }