void Lmpath_ToRefresh(object sender, EventArgs e) { if (lmpath != null) { main_tabControl.TabPages.Remove(lmpathtab); lmpath = null; } }
private void Lmpath_menu_Click(object sender, EventArgs e) { if (lmpath == null) { lmpath = new LMasterpath(); lmpathtab = new TabPage("MPATH"); lmpath.LMpath_NeedToRefresh += Lmpath_ToRefresh; main_tabControl.TabPages.Add(lmpathtab); lmpathtab.Controls.Add(lmpath); lmpath.Dock = DockStyle.Fill; lmpath.Show(); lmpath.BringToFront(); } lmpath.ListRefresh(); main_tabControl.SelectTab(lmpathtab); }