分页显示_AfterLoad
Dim st As Date = Date.Now
Forms("稍后窗").Show()
Dim lvw As WinForm.ListView =
e.Form.Controls("ListView1")
lvw.CheckBoxes = True
systemready = False
lvw.StopRedraw() '暂停绘制
lvw.Rows.Clear() '清除原来的行
lvw.Images.Clear() '清除原来的图片
lvw.View = ViewMode.LargeIcon '显示模式为大图标
lvw.Images.LargeSize = New Size(180,120) '定义大图标尺寸
For Each dr As Row In Tables("产品数据库").Rows '从数据表中提取数据
Dim Key As String = dr("产品效果图") '获取此员工的照片文件
lvw.Images.AddLargeImage(Key,Vars("IP") & Key) '添加照片,直接用文件名作为图片键值
Dim vr As WinForm.ListViewRow
= lvw.Rows.Add() '增加一行
vr.Text = dr("产品编号") & dr("产品名称") '设置标题
vr.ImageKey = Key '设置图片键值
vr.Tag = dr
Next
lvw.ResumeRedraw()
'恢复绘制
systemready = True
Forms("稍后窗").Close()
MessageBox.Show("抱歉!让您久等了:
" & (Date.Now - st).TotalSeconds & "秒")
'
'Dim trv As
WinForm.TreeView = e.Form.Controls("TreeView1")
'trv.BuildTree("产品数据库",
"家具风格|家具分类|产品名称")
'trv.Nodes.Insert("显示所有行",0)
'
Dim lbl As
WinForm.Label
lbl =
e.Form.Controls("Welcome")
lbl.Text = "今天是"
& format(Today,"yyyy年MM月dd日")
& " 天禧家欢迎您!"
分页显示_btnShow_Click
Dim lvw As
WinForm.ListView = e.Form.Controls("ListView1")
Dim pg As Integer
= e.Form.Controls("Label1").Text
lvw.CheckBoxes =
True
systemready =
False
Dim idx1 As Integer
= (pg - 1) * 20 '获取要显示的第一行
Dim idx2 As
Integer = pg * 20 - 1 '获取要显示的最末行
idx2 =
Math.Min(DataTables(Vars("表A")).dataRows.Count -1,idx2) 'idx2不能超过表的最大行数
For idx As Integer
= idx1 To idx2
lvw.StopRedraw() '暂停绘制
lvw.Rows.Clear() '清除原来的行
lvw.Images.Clear()
'清除原来的图片
lvw.View =
ViewMode.LargeIcon '显示模式为大图标
lvw.Images.LargeSize
= New Size(150,100) '定义大图标尺寸
For Each dr As Row
In Tables("产品数据库").Rows '从数据表中提取数据
Dim Key As String = dr("产品效果图") '获取此员工的照片文件
lvw.Images.AddLargeImage(Key,Vars("IP")
& Key) '添加照片,直接用文件名作为图片键值
Dim vr As WinForm.ListViewRow = lvw.Rows.Add() '增加一行
vr.Text = dr("编号备注") & dr("产品名称") '设置标题
vr.ImageKey = Key '设置图片键值
vr.Tag = dr
Next
Next
lvw.ResumeRedraw()
'恢复绘制
systemready = True
分页显示_第一页_Click
Dim lbl As WinForm.Label =
e.Form.Controls("Label1")
Dim btn As WinForm.Button =
e.Form.Controls("btnShow")
Dim pg As Integer = lbl.Text '当前页号
If pg <> 1 Then
lbl.Text = 1
End If
btn.PerformClick() '模拟单击显示按钮
分页显示_上一页_Click
Dim lbl As WinForm.Label =
e.Form.Controls("Label1")
Dim btn As WinForm.Button =
e.Form.Controls("btnShow")
Dim pg As Integer = lbl.Text '当前页号
If pg > 1 Then
lbl.Text = pg - 1
End If
btn.PerformClick() '模拟单击显示按钮
分页显示_下一页_Click
Dim lbl As WinForm.Label =
e.Form.Controls("Label1")
Dim btn As WinForm.Button =
e.Form.Controls("btnShow")
Dim pg As Integer = lbl.Text '当前页号
Dim pgs As Integer =
math.Ceiling(DataTables(Vars("表A")).DataRows.Count / 20) '计算出总页数
If pg < pgs Then
lbl.Text = pg + 1
End If
btn.PerformClick() '模拟单击显示按钮