以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  listview 显示错位  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=88625)

--  作者:xujie80
--  发布时间:2016/8/6 10:27:00
--  listview 显示错位
在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
--  发布时间:2016/8/6 12:14:00
--  
已经找到原因
多了一行
r = lvw.Rows.Add() \'再增加一行