Foxtable(狐表)用户栏目专家坐堂 → 求助 动态添加列的图片


  共有2442人关注过本帖树形打印复制链接

主题:求助 动态添加列的图片

帅哥哟,离线,有人找我吗?
有点色
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/11 0:37:00 [显示全部帖子]

For  i As Integer=0 To Tables("qrymyf").rows.count-1
    Dim txt As WinForm.PictureBox
    txt = e.Form.CreateControl("Pic_" & i, ControlTypeEnum.PictureBox)
    txt.BackColor = Color.Black
    txt.SizeMode = ImageSizeMode.Zoom
    txt.BorderStyle = BorderStyle.Fixed3D
    txt.Width = 200
    txt.Height = 250
    txt.Left = 220*i + 50
    txt.Top = 35
    e.Form.Controls("Panel1").AddControl(txt)
    txt.image = GetImage(ProjectPath & "attachments/" & Tables("qrymyf").rows(i)("ltsu"))
Next

 回到顶部
帅哥哟,离线,有人找我吗?
有点色
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/5/22 8:32:00 [显示全部帖子]

筛选之后执行代码

 

e.Form.Controls("Panel1").children.clear
For  i As Integer=0 To Tables("qrymyf").rows.count-1
    Dim txt As WinForm.PictureBox
    txt = e.Form.CreateControl("Pic_" & i, ControlTypeEnum.PictureBox)
    txt.BackColor = Color.Black
    txt.SizeMode = ImageSizeMode.Zoom
    txt.BorderStyle = BorderStyle.Fixed3D
    txt.Width = 200
    txt.Height = 250
    txt.Left = 220*i + 50
    txt.Top = 35
    e.Form.Controls("Panel1").AddControl(txt)
    txt.image = GetImage(ProjectPath & "attachments/" & Tables("qrymyf").rows(i)("ltsu"))
Next


 回到顶部