0
나는 이런 식으로 윈도우 폼에서 임의의 위치에 대한 몇 가지 버튼을 넣어 시도 :for 루프에 buttonlocation을 추가하는 방법은 무엇입니까?
for (int i = 0; < shuffle.Length; i++)
{
//This line doesn't work
Controls["button" + (i + 1).ToString()].Location = new Point(shuffle[i], 250);
//But this line is OK
Controls["button" + (i + 1).ToString()].Text = text[i];
}
내가 다음 줄을 쓸 때 잘 작동되지만 루프에 그것을 넣어 1,2를 변경하고 3하는 방법 (i +1)?
button1.Location = new Point(shuffle[0], 250);
button2.Location = new Point(shuffle[1], 250);
button3.Location = new Point(shuffle[2], 250);
어떤 예외가 발생했는지 확인해야합니다. – Thor