Foxtable(狐表)用户栏目专家坐堂 → 请教大师


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

主题:请教大师

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


加好友 发短信
等级:三尾狐 帖子:655 积分:5085 威望:0 精华:0 注册:2013/10/7 22:27:00
请教大师  发帖心情 Post By:2017/2/18 23:11:00 [只看该作者]

各位大师:您们好!

我的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") & vbcrlf & "进    度: " & dr("fjya") & vbcrlf & "发布日期: " & dr("vdmhjjad") & vbcrlf & "纸样师: " & dr("xqsujgm") & vbcrlf & "纸样进度: " & dr("xqsufjya") & vbcrlf & "车板师: " & dr("lgsrjgm") & vbcrlf & "车板进度: " & dr("lgsrfjya") & vbcrlf & "" & vbcrlf & "双击图像可以打开 款式资料 修改"& vbcrlf & "经理级别 右键单击图样后, 右击可打开 发布窗口"
                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

修改Button的代码:Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
Dim vr As WinForm.ListViewRow = lvw.Current '获取ListView的当前行
If vr Is Nothing Then '如果不存在当前行,也就是内有选定任何一行
    Return
Else
    lvw.StopRedraw
    Dim dr As DataRow = vr.tag '获取此行对应的DataRow
    Dim ps As Integer = Tables("qrymyf").FindRow(dr)
    If ps >= 0 Then
        Tables("qrymyf").Position = ps
        Forms("ymyf").Open(600,150)
        Tables("qrymyf").Current.Locked = False
        vr.Retrieve() '通知ListView,重新生成此行
        lvw.ResumeRedraw
    End If
End If

RowActivate代码:Dim btn As WinForm.Button = e.Form.Controls("Button7")
btn.PerformClick()

图片达到20个,打开ymyf窗口要很久。多谢指教!


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


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

 单独打开ymyf窗口,需不需要很久?

 

 如果直接打开没问题,说明设置position的时候有问题,可能触发了currentChanged等耗时的代码。


 回到顶部