private void checkBox_showGraphs_CheckedChanged(object sender, EventArgs e) { xSenderCheckbox = (CheckBox)sender; if (((CheckBox)sender).Checked) { // Load and start form formCharts = new FormCharts(this); formCharts.chartsExitEventHandler += new FormCharts.ChartsExitEventHandler(eventMethod_chartsExitEventHandler); formCharts.Show(); } else { formCharts.Close(); } }
private void eventMethod_chartsExitEventHandler() { formCharts = null; }