代码往TableLayouPanel上添加Label,连续添加两个不一样的Label,第二个会变成和第一个一样,求解

解决方案 »

  1.   

    ..不是location的问题吧,TableLLayouPanel里控件会自动排的呀
      

  2.   

     this.tableLayoutPanel1.Controls.Add(this.Labe11, 0, 0);
     this.tableLayoutPanel1.Controls.Add(this.Labe12, 1, 0);
     this.tableLayoutPanel1.Controls.Add(this.Labe13, 1, 1);
     this.tableLayoutPanel1.Controls.Add(this.button4, 0, 1);
      

  3.   

    ……还是贴代码,大家帮帮看有什么错
    是个插件式程序,主窗体加载2个dll,每个dll添加一个不同的Label//这是主窗体
    string path = Application.StartupPath + "\\Plugins";
    foreach (string file in Directory.GetFiles(path, "*.dll"))
                {
                    string asmFile = file;
    if (asmFile == string.Empty)
                    {
                        continue;
                    }
    Assembly asm = Assembly.LoadFrom(asmFile);
                     InterFace.jiekou jk = (InterFace.jiekou)
                         Activator.CreateInstance(asm.GetType("Wid.lbl"));
    jk.JK(this,tableLayouPanel1,tableLayouPane2,imageList1);//第一个dll
    Label l = new Label();
                l.AutoSize = false;
                l.Text = "A";
                l.Size = new Size(200, 34);
                tab.Controls.Add(l);
    //第二个dll
    Label l = new Label();
                l.AutoSize = false;
                l.Text = "B";
                l.Size = new Size(200, 34);
                tab.Controls.Add(l);运行后主窗体出现了两个A,没有B..