Foxtable(狐表)用户栏目专家坐堂 → listview 显示错位


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

主题:listview 显示错位

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


加好友 发短信
等级:小狐 帖子:350 积分:3412 威望:0 精华:0 注册:2015/5/12 15:33:00
listview 显示错位  发帖心情 Post By:2016/8/6 10:27:00 [只看该作者]

在listview 生成时,用下列代码

Dim lb2 As WinForm.textbox
lb2 = e.Form.CreateControl("政策补助", ControlTypeEnum.textbox)
lb2.Text = DataTables("员工资料").sqlcompute("count(*)","政策性补助类型<>''")
lb2.Left = 20
lb2.Top = 120
lb2.width = 50
lb2.backcolor = Color.lightblue
e.Form.AddControl(lb2)

Dim r2 As WinForm.label
r2 = e.Form.CreateControl("政策补助", ControlTypeEnum.label)
r2.Text = "人"
r2.Top = 122
r2.left = 70
e.Form.AddControl(r2)

'===五保户合计生成====

Dim lb3 As WinForm.textbox
lb3 = e.Form.CreateControl("五保户", ControlTypeEnum.textbox)
lb3.Text = DataTables("员工资料").sqlcompute("count(*)","五保户供养方式<>''")
lb3.Left = 115
lb3.Top = 120
lb3.width = 50
lb3.backcolor = Color.lightblue
e.Form.AddControl(lb3)

Dim r3 As WinForm.label
r3 = e.Form.CreateControl("五保户", ControlTypeEnum.label)
r3.Text = "人"
r3.Top = 122
r3.left = 165
e.Form.AddControl(r3)

'===困境人员合计生成====

Dim lb4 As WinForm.textbox
lb4 = e.Form.CreateControl("困境", ControlTypeEnum.textbox)
lb4.Text = DataTables("员工资料").sqlcompute("count(*)","困境原因<>''")
lb4.Left = 210
lb4.Top = 120
lb4.width = 50
lb4.backcolor = Color.lightblue
e.Form.AddControl(lb4)

Dim r4 As WinForm.label
r4 = e.Form.CreateControl("困境", ControlTypeEnum.label)
r4.Text = "人"
r4.Top = 122
r4.left = 260
e.Form.AddControl(r4)

'===低保户合计生成====

Dim lb5 As WinForm.textbox
lb5 = e.Form.CreateControl("低保户", ControlTypeEnum.textbox)
lb5.Text = DataTables("员工资料").sqlcompute("count(*)","低保情况<>''")
lb5.Left = 300
lb5.Top = 120
lb5.width = 50
lb5.backcolor = Color.lightblue
e.Form.AddControl(lb5)

Dim r5 As WinForm.label
r5 = e.Form.CreateControl("低保户", ControlTypeEnum.label)
r5.Text = "人"
r5.Top = 122
r5.left = 350
e.Form.AddControl(r5)

'===残疾合计生成====

Dim lb6 As WinForm.textbox
lb6 = e.Form.CreateControl("残疾", ControlTypeEnum.textbox)
lb6.Text = DataTables("员工资料").sqlcompute("count(*)","残疾类别<>''")
lb6.Left = 390
lb6.Top = 120
lb6.width = 50
lb6.backcolor = Color.lightblue
e.Form.AddControl(lb6)

Dim r6 As WinForm.label
r6 = e.Form.CreateControl("残疾", ControlTypeEnum.label)
r6.Text = "人"
r6.Top = 122
r6.left = 440
e.Form.AddControl(r6)

'===重残合计生成====

Dim lb7 As WinForm.textbox
lb7 = e.Form.CreateControl("重残", ControlTypeEnum.textbox)
lb7.Text = DataTables("员工资料").sqlcompute("count(*)","重残月救助标准<>''")
lb7.Left = 480
lb7.Top = 120
lb7.width = 50
lb7.backcolor = Color.lightblue
e.Form.AddControl(lb7)

Dim r7 As WinForm.label
r7 = e.Form.CreateControl("重残", ControlTypeEnum.label)
r7.Text = "人"
r7.Top = 122
r7.left = 530
e.Form.AddControl(r7)

结果加载后出现错位

图片点击可在新窗口打开查看此主题相关图片如下:a.png
图片点击可在新窗口打开查看
查了一下没发现原因,请大师指点,另外,合计生成可不可用循环语句?


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


加好友 发短信
等级:小狐 帖子:350 积分:3412 威望:0 精华:0 注册:2015/5/12 15:33:00
  发帖心情 Post By:2016/8/6 12:14:00 [只看该作者]

已经找到原因
多了一行
r = lvw.Rows.Add() '再增加一行

 回到顶部