当我试图显示下划线时,我试图制作的刽子手游戏在 for 循环中抛出“ArgumentOutOfRangeException”。我尝试重写代码,但没有任何效果。
List<Label> underline;
int left = 300;
int top = 275;
for (int i = 0; i < data.solution.Length; i++) //data is the object that contains the word that is the solution
{
underline = new List<Label>();
underline[i].Parent = this;
underline[i].Text = "_";
underline[i].Size = new Size(35, 35);
underline[i].Location = new Point(left, top);
left += 30;
underline[i].Font = new Font(new FontFamily("Microsoft Sans Serif"), 20, FontStyle.Bold);
}
我不明白这有什么问题。当我点击新游戏时它会立即抛出它。
心有法竹
相关分类