-- 作者:cxmxjwlmq
-- 发布时间:2021/3/5 0:34:00
-- 任务栏中任务名称为啥不变更
各位老师:
我想在任务栏页面的任务中,点击任务名称后,消除提示的未读信息后将任务名称变更为人员名称。
但下面的代码没有达到我要的效果:代码在任务栏TopicLinkClick事件
Dim wdxxfxr As List(Of String) = DataTables("交流信息").getvalues("Name","Read = 0") \'未读信息发信人 For Each fxr As String In wdxxfxr Dim Values() As String = fxr.split(".") Dim wdxx As Integer = DataTables("交流信息").Compute("Count([Name])", "Read = 0 and Name = \'" & fxr & "\'") \'每个发信人的未读信息 Select Case e.Link.Name Case Values(1) & "(" & wdxx & "条)" ,Values(1) & "(" & wdxx & "条)" e.Form.Controls("TextBox4").value = Values(1) Dim cr As DataRow = DataTables("Users").Find("Name = " & "\'" & Values(1) & "\'" ) e.Form.Controls("TextBox5").value = cr("bm") & "." & cr("Name") DataTables("交流信息").ReplaceFor("Read", 1, "Name like \'" & cr("bm") & "." & cr("Name") & "\' And Read = 0 ")
Dim tbp As WinForm.TopicBar = e.Form.Controls("TopicBar1") For Each pg As WinForm.TopicPage In tbp.Pages For Each lnk As WinForm.TopicLink In pg.Links lnk.Text = lnk.Name Next Next e.Link.text = Values(1) \' & "←会话" End Select Next
现在是点击任务名称,可变成发信人的名称,如下图
此主题相关图片如下:微信图片_20210305002925.png
此主题相关图片如下:微信图片_20210305002931.png
但我点击别的任务时,又恢复成初始状,如下图:
此主题相关图片如下:微信图片_20210305002939.png
另:
这个窗口的AfterLoad代码如下:
Dim wdxxfxr As List(Of String) = DataTables("交流信息").getvalues("Name","Read = 0") \'未读信息发信人 For Each fxr As String In wdxxfxr Dim Values2() As String = fxr.split(".") Dim wdxx As Integer = DataTables("交流信息").Compute("Count([Name])", "Read = 0 and Name = \'" & fxr & "\'") \'未读信息 Dim Page As WinForm.TopicPage = Forms("OpenQQ").Controls("TopicBar1").Pages("页面1") \'在页面1上增加任务 Page.Links.Add( Values2(1) & "(" & wdxx & "条)" ,Values2(1) & "(" & wdxx & "条)") Next
请各位老师指教!谢谢!
|