'此段代码用于显示OpenQQ的未读消息
Static OpenQQ As RibbonMenu.Button
Static LastTime As Date
If OpenQQ Is Nothing Then
OpenQQ = ConfigBar.Items("OpenQQ")
End If
Dim txt As String
If QQClient.Ready Then
If QQClient.UnreadCount > 0 Then
txt = "(" & QQClient.UnreadCount & "条)"
End If
End If
If OpenQQ.Text <> txt Then
OpenQQ.Text ="OpenQQ" & txt
End If
If OpenQQ.Text > "" And OpenQQ.Text <> "OpenQQ" Then
Dim ntp As timeSpan = Date.Now - LastTime
If ntp.TotalSeconds >= 0.5 Then
LastTime = Date.Now
If OpenQQ.ForeColor = Color.Red Then
OpenQQ.ForeColor = Color.Transparent
Else
OpenQQ.ForeColor = Color.Red
End If
End If
End If
上段是示例文件给的;
‘///////////////////////////////////
Static jlxx As RibbonMenu.Button
Static LastTime1 As Date
If jlxx Is Nothing Then
jlxx= ConfigBar.Items("交流信息")
End If
txt = "(" & DataTables("交流信息").SQLCompute("Count(接收人)","已处理=0 And 接收人='" & _Userbm & "." & _username & "'") & "条)"
If jlxx.Text <> txt Then
jlxx.Text ="交流信息" & txt
End If
If jlxx.Text > "" And jlxx.Text <> "交流信息" Then
Dim ntp As timeSpan = Date.Now - LastTime1
If ntp.TotalSeconds >= 0.5 Then
LastTime1 = Date.Now
If jlxx.ForeColor = Color.Red Then
jlxx.ForeColor = Color.Transparent
Else
jlxx.ForeColor = Color.Red
End If
End If
End If
这是我模仿的。在配置栏中已经加入了 《交流信息》这个菜单项,出错!

此主题相关图片如下:ccc.jpg

问题出在哪呢?谢谢