void Lspath_ToRefresh(object sender, EventArgs e) { if (lspath != null) { main_tabControl.TabPages.Remove(lspathtab); lspath = null; } }
private void Lspath_menu_Click(object sender, EventArgs e) { if (lspath == null) { lspath = new LSpath(); lspathtab = new TabPage("MPATH"); lspath.LSpath_NeedToRefresh += Lspath_ToRefresh; main_tabControl.TabPages.Add(lspathtab); lspathtab.Controls.Add(lspath); lspath.Dock = DockStyle.Fill; lspath.Show(); lspath.BringToFront(); } lspath.ListRefresh(); main_tabControl.SelectTab(lspathtab); }