private void _showPreview_CheckedChanged(object sender, EventArgs e) { if (_showPreview.Checked) { if (preview == null) { preview = new MatchPreview(); preview.FormClosed += new FormClosedEventHandler(preview_FormClosed); preview.Show(this); _previewAutoHide.Show(); } else { preview.BringToFront(); } } else { if (preview != null) { preview.Close(); } } }
void preview_FormClosed(object sender, FormClosedEventArgs e) { preview = null; _showPreview.Checked = false; _previewAutoHide.Show(); }