If CurrentTable Is Nothing Then
Return
End If
'此段代码用于显示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
ConfigBar.Items("OpenQQ").SmallImage = GetImage("online.ico")
Dim Page As WinForm.TopicPage
If QQClient.UnreadCount > 0 Then
txt = "(" & QQClient.UnreadCount & "条)"
If Forms("导航栏").Opened Then
Page = Forms("导航栏").Controls("TopicBar1").Pages("消息")
page.Visible = True
Page.Links("未读消息").Text = "您有未读消息" & txt & ",请查看"
Page.Links("未读消息").ImageFile = "online.ico"
End If
ElseIf QQClient.UnreadCount = 0 AndAlso Forms("导航栏").Opened Then
Page = Forms("导航栏").Controls("TopicBar1").Pages("消息")
page.Visible = False
End If
If OpenQQ.Text <> txt Then
OpenQQ.Text = txt
End If
If OpenQQ.Text > "" 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
If Forms("导航栏").Opened Then
Page = Forms("导航栏").Controls("TopicBar1").Pages("消息")
If Page.Links("未读消息").ImageFile = "online.ico" Then
Page.Links("未读消息").ImageFile = "offline.ico"
Else
Page.Links("未读消息").ImageFile = "online.ico"
End If
End If
End If
End If
Else
ConfigBar.Items("OpenQQ").SmallImage = GetImage("offline.ico")
End If