需要在下面foreach 里面生成一个动态linkbottn 控件  这是在一个datamoe 类里foreach (object o in list)
                {
                    var a = (Dictionary<string, System.Object>)o;
  
                        _ListData.Add(new Test() { Key = "" + i++, ID = a["user_id"].ToString(), Uname = a["user_name"].ToString(), Email = a["email"].ToString(), Phone = a["phone_mob"].ToString(), reg_time = a["reg_time"].ToString(), gender = sex, im_qq = a["im_qq"].ToString(), logins = a["logins"].ToString(),  });
 
                  
                }]
C#

解决方案 »

  1.   

    linkbottn?or LinkLabel?
    System.Windows.Forms.LinkLabel linkButton = new System.Windows.Forms.LinkLabel();
      

  2.   


    怎么添加到:_ListData.Add(new Test() { Key = "" + i++, ID = a["user_id"].ToString(), Uname = a["user_name"].ToString(), Email = a["email"].ToString(), Phone = a["phone_mob"].ToString(), reg_time = a["reg_time"].ToString(), gender = sex, im_qq = a["im_qq"].ToString(), logins = a["logins"].ToString(),  });
    这个里面显示?
      

  3.   

      int x = 10;
                int y = 10;
                Sys_PorjectsBLL bll = new Sys_PorjectsBLL();
                List<Sys_PorjectsModel> models = bll.GetModelList("");
                foreach (Sys_PorjectsModel item in models)
                {
                    PictureBox btn = new PictureBox();
                    MemoryStream ms = new MemoryStream(item.PROIMAGE);
                    Bitmap bmpt = new Bitmap(ms,true);
                   btn.Image = ResizePic(bmpt, 50, 50);
                    btn.Size = new Size(50 ,50);
                    btn.BackColor = Color.Transparent;
                    btn.Location = new Point(x, y);
                    btn.Tag = string.Format(@"“" + item.ProjectItems + @"\" + item.ProTitle + "”");
                    btn.MouseDoubleClick += new MouseEventHandler(btn_MouseDoubleClick);
                    this.kryptonPage1.Controls.Add(btn);//向控件中添加新建控件
                    if (x < this.kryptonPage1.Width)
                    {
                        x += 10 + 50;
                    }
                    if (x >= this.kryptonPage1.Width)
                    {
                        x = 10;
                        y += 10 + 50;
                    }
                }
      

  4.   


    怎么添加到:_ListData.Add(new Test() { Key = "" + i++, ID = a["user_id"].ToString(), Uname = a["user_name"].ToString(), Email = a["email"].ToString(), Phone = a["phone_mob"].ToString(), reg_time = a["reg_time"].ToString(), gender = sex, im_qq = a["im_qq"].ToString(), logins = a["logins"].ToString(),  });
    这个里面显示?添加到这个里面是什么意思, 你这 _ListData  不是个 List<Test> _ListData 对象么? 似乎只是添加数据而已吧。  
      

  5.   

    4楼的,差不多一个意思,把控件改成你的 “linkbutton” ,再往你的父控件中Add, 最主要是位置的控制。,