public MainForm() { InitializeComponent(); downloadListPanel = new DownloadListPanel(); downloadListPanel.VisibleChanged += (s, e) => { downloadsVisibleMenuItem.Checked = downloadListPanel.Visible; }; downloadsVisibleMenuItem.Click += (s, e) => { ToggleDocked(downloadListPanel); }; consolePanel = new ConsolePanel(); consolePanel.VisibleChanged += (s, e) => { consoleVisibleMenuItem.Checked = consolePanel.Visible; }; consoleVisibleMenuItem.Click += (s, e) => { ToggleDocked(consolePanel); }; }