public void DisplayPage(Panel panel, PageControl page) { list = panel2.Controls.OfType <PageControl>().ToList().OrderBy(pa => pa.Position).ToList(); if (!panel.Contains(page)) { panel2.Controls.Add(page); } page.Dock = DockStyle.Fill; page.BringToFront(); }