내가 루프이있다 : 당신이 볼 수있는, 내가 이름 "PanelContainer1"를 생성 패널 준 그래서C# 프로그램이 실행되는 동안 생성되는 패널에 도달하는 방법은 무엇입니까?
int iPanelNumber = 1;
foreach (string[] Persons in alItems)
{
Panel pPanelContainer = new Panel();
pPanelContainer.Width = contentPanel.Width;
pPanelContainer.Height = 50;
pPanelContainer.BackColor = Color.FromArgb(
Convert.ToInt32(aWhiteContentBackgroundColors[0]),
Convert.ToInt32(aWhiteContentBackgroundColors[1]),
Convert.ToInt32(aWhiteContentBackgroundColors[2]));
pPanelContainer.Name = "PanelContainer" + iPanelNumber.ToString();
pPanelContainer.Visible = false;
pPanelContainer.Location = new Point(0, 0);
}
, "PanelContainer2"등 ...
하지만 내가 어떻게 도달 할 수 이 패널들?
나는 확실히 서면에 의해 그들에 도달 할 수 :
PanelContainer1.visible = true;
누구나 생각이있어?
BTW : 루프에서 iPanelNumber를 증가시키지 않습니다! 사본입니까/과거인가요? – M4N