以文本方式查看主题 - 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=77055) |
-- 作者:ehomecd -- 发布时间:2015/11/10 14:32:00 -- [求助]关于listview平铺方式显示数据,隐藏行的问题 [求助]关于listview平铺方式显示数据,隐藏行的问题 在listview增加【学生编号】字段,是为了在rowactivate中引用【学生编号】, 但有不想让【学生编号】在listview中显示出来,如何在listview中隐藏这个字段? Dim lvw As WinForm.ListView = e.Form.Controls("ListView1") lvw.StopRedraw() \'暂停绘制 lvw.Rows.Clear() \'清除原来的行 lvw.Images.Clear() \'清除原来的图片 lvw.View = ViewMode.Tile \'显示模式为平铺 lvw.Images.LargeSize = New Size(110,138) \'定义大图标尺寸 lvw.TitleSize = New Size(200,160) \'设置平铺区域的大小 Dim cls() As String = {"学生编号","姓名","空行","金币","空行2","当前印章","空行3","勋章","空行4","经验值"} \'定义列名 For i As Integer = 0 To cls.Length - 1 \'增加列 Dim c As WinForm.ListViewColumn = lvw.Columns.Add() c.Name = cls(i) \'指定列名 Next For Each dr As DataRow In DataTables("学生信息").Select("", "累计获得金币 desc") \'从数据表中提取数据 Dim Key As String = dr("照片").Replace("//", "") \'获取此员工的照片文件 Dim img As String = ProjectPath & "RemoteFiles/" & key lvw.Images.AddLargeImage(Key, img) \'添加照片,直接用文件名作为图片键值 Dim vr As WinForm.ListViewRow = lvw.Rows.Add() \'增加一行 vr.ToolTipText = dr("团队名称") \'设置此行的动态提示 vr.ImageKey = Key \'设置图片键值 vr("学生编号") = dr("学生编号") vr("姓名") = dr("姓名") vr("空行") = " " vr("金币") = "金币:" & dr("金币") vr("空行2") = " " .............................
|
-- 作者:大红袍 -- 发布时间:2015/11/10 15:07:00 -- Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw() \'暂停绘制
lvw.Rows.Clear() \'清除原来的行
lvw.Images.Clear() \'清除原来的图片
lvw.View = ViewMode.Tile \'显示模式为平铺
lvw.Images.LargeSize = New Size(110,138) \'定义大图标尺寸
lvw.TitleSize = New Size(200,160) \'设置平铺区域的大小
Dim cls() As String = {"姓名","空行","金币","空行2","当前印章","空行3","勋章","空行4","经验值"} \'定义列名
For i As Integer = 0 To cls.Length - 1 \'增加列
Dim c As WinForm.ListViewColumn = lvw.Columns.Add()
c.Name = cls(i) \'指定列名
Next
For Each dr As DataRow In DataTables("学生信息").Select("", "累计获得金币 desc") \'从数据表中提取数据
Dim Key As String = dr("照片").Replace("//", "") \'获取此员工的照片文件
Dim img As String = ProjectPath & "RemoteFiles/" & key
lvw.Images.AddLargeImage(Key, img) \'添加照片,直接用文件名作为图片键值
Dim vr As WinForm.ListViewRow = lvw.Rows.Add() \'增加一行
vr.ToolTipText = dr("团队名称") \'设置此行的动态提示
vr.ImageKey = Key \'设置图片键值
vr("姓名") = dr("姓名")
vr("空行") = " "
vr("金币") = "金币:" & dr("金币")
vr("空行2") = " "
|
-- 作者:大红袍 -- 发布时间:2015/11/10 15:08:00 -- Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw() \'暂停绘制
lvw.Rows.Clear() \'清除原来的行
lvw.Images.Clear() \'清除原来的图片
lvw.View = ViewMode.Tile \'显示模式为平铺
lvw.Images.LargeSize = New Size(110,138) \'定义大图标尺寸
lvw.TitleSize = New Size(200,160) \'设置平铺区域的大小
Dim cls() As String = {"学生编号","姓名","空行","金币","空行2","当前印章","空行3","勋章","空行4","经验值"} \'定义列名
For i As Integer = 0 To cls.Length - 1 \'增加列
Dim c As WinForm.ListViewColumn = lvw.Columns.Add()
c.Name = cls(i) \'指定列名
Next
For Each dr As DataRow In DataTables("学生信息").Select("", "累计获得金币 desc") \'从数据表中提取数据
Dim Key As String = dr("照片").Replace("//", "") \'获取此员工的照片文件
Dim img As String = ProjectPath & "RemoteFiles/" & key
lvw.Images.AddLargeImage(Key, img) \'添加照片,直接用文件名作为图片键值
Dim vr As WinForm.ListViewRow = lvw.Rows.Add() \'增加一行
vr.ToolTipText = dr("团队名称") \'设置此行的动态提示
vr.ImageKey = Key \'设置图片键值
If 某某条件 Then vr("学生编号") = " "
Else
vr("学生编号") = dr("学生编号")
End If
vr("姓名") = dr("姓名")
vr("空行") = " "
vr("金币") = "金币:" & dr("金币")
vr("空行2") = " "
|