Foxtable(狐表)用户栏目专家坐堂 → 求助


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

主题:求助

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


加好友 发短信
等级:三尾狐 帖子:655 积分:5085 威望:0 精华:0 注册:2013/10/7 22:27:00
求助  发帖心情 Post By:2017/3/30 22:20:00 [只看该作者]

您 好!大师:
这是我的"ListView" 代码, 在显示图标是降序,请大师指教! 谢谢!!!
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw
lvw.View = ViewMode.LargeIcon '显示模式为详细内容
lvw.GridLines = False '显示网格线
lvw.MultiSelect = False  '禁止选择多行
Dim cls() As String = {"ffikgn","kkth","ptyn"}
Dim wds() As Integer = {70,70,70}  '定义列宽
For i As Integer = 0 To  cls.Length - 1
    Dim c As WinForm.ListViewColumn = lvw.Columns.Add()
    c.Name = cls(i)  '指定列名
    c.Text = cls(i) '指定列标题
    c.Width = wds(i)  '指定列宽
Next
lvw.Columns("ffikgn").Text = "款号"
lvw.Columns("kkth").Text = "品牌"
lvw.Columns("ptyn").Text = "客户"
lvw.VirtualMode = True  '以虚拟模式显示
lvw.VirtualListSize = Tables("qrymyf").Rows.count
lvw.ResumeRedraw
这是"ListView"图标代码:
If Tables("qrymyf").Rows.Count = 0 Then
    Return
End If
If Tables("qrymyf").current.IsNull("ltsu") = False Then
   ' Tables("qrymyf").Sort = "ltsu DESC"
    Dim tt As Table = Tables("yywrkhtc")
    Dim lt = tt(0)("khtc") & "\"
    Dim lvw As WinForm.ListView = e.Sender
'    lvw.StopRedraw
    Dim dr As DataRow = DataTables("qrymyf").dataRows(e.Index) '根据行位置从数据表中取得对应的DataRow
    Dim Key As String = dr("ltsu")
    lvw.Images.LargeSize = New Size(100,150)
    lvw.Images.AddImage(Key,lt & Key & ".",lt & Key & ".")
    e.Row.Imagekey = key '指定图标键值
    e.Row.Tag = dr '将DataRow赋值给ListViewRow的Tag属性,将二者联系起来
    For Each cl As WinForm.ListViewColumn In lvw.Columns '逐列取值
        Select Case cl.Name
            Case "ffikgn","ffaa" '如果是人口列或面积列
                e.Row(cl.Name) = dr(cl.Name) '则显示千位分割符号
            Case Else
                e.Row(cl.Name) = dr(cl.Name)
                e.Row.ToolTipText = "设 计 师: " & dr("ymyfjgm") 
                Dim nm As String = dr("vdmh")
                Dim nm2 As String = dr("pjsy")
                If nm = False And nm2 = False Then
                    e.Row.ForeColor =  Color.White
                ElseIf nm = True And nm2 = False Then
                    e.Row.ForeColor =  Color.DeepSkyBlue
                ElseIf nm2 = True Then
                    e.Row.ForeColor =  Color.Lime
                End If
        End Select
    Next
'    lvw.ResumeRedraw
End If

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/3/30 22:51:00 [只看该作者]

Dim dr As DataRow = DataTables("qrymyf").dataRows(e.Index) '根据行位置从数据表中取得对应的DataRow

 

改成

 

Dim drs = DataTables("qrymyf").Select("", "ltsu DESC")

Dim dr As DataRow = drs(e.Index) '根据行位置从数据表中取得对应的DataRow


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


加好友 发短信
等级:三尾狐 帖子:655 积分:5085 威望:0 精华:0 注册:2013/10/7 22:27:00
  发帖心情 Post By:2017/3/31 21:44:00 [只看该作者]

谢谢大师!!!

 回到顶部