我已经为图片框写了循环,它看起来像这样:
void labelAdder()
{
List<Label> labels = new List<Label>();
List<TextBox> texboxex = new List<TextBox>();
List<PictureBox> pictureBoxes = new List<PictureBox>();
for (int i = 0; i < args.Length - 1; i++)
{
equals++;
var temp = new TextBox();
var temp2 = new PictureBox();
int x = 10;
int y = xD * equals;
temp.Location = new Point(x, y);
temp2.Location = new Point(x + 100, y);
temp2.Image = global::Xbox360_Complex_Checker.Properties.Resources.button_offline;
temp.Text = args[i];
temp2.Text = status[i];
this.Controls.Add(temp);
this.Controls.Add(temp2);
temp.Show();
temp2.Show();
texboxex.Add(temp);
pictureBoxes.Add(temp2);
}
}
我的问题是PictureBox
仅在第一个textBox
旁边加载,它应该加载到所有textBox旁边。我不知道为什么它不起作用。我尝试使用标签,标签正确加载。