0

我已经为图片框编写了循环,它看起来像这样:

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仅在 first 旁边加载textBox,它应该在所有文本框旁边加载。我不知道为什么它不起作用。我用标签试过这个,标签加载正确。

4

0 回答 0