for (int i = 0; i < count; i++) { int val = random.Next(count); if (val != i) { temp = panels[i].Controls[0] as Button; panels[i].Controls.Clear(); panels[i].Controls.Add(panels[val].Controls[0] as Button); panels[val].Controls.Clear(); panels[val].Controls.Add(temp); } }
if (p.HasChildren) ((Button)p.Controls[0]).Visible = true;