老师
1. 我的项目是以窗口展示的 那么我在窗口中创建一个按钮来模拟 菜单栏上配置栏的openQQ状态菜单
判断openQQ的链接状态的语句是什么呢?
2. 我用这段代码能否让按钮显示未读条数呢
Static OpenQQ As WinForm.Button
Static LastTime As Date
If OpenQQ Is Nothing Then
OpenQQ = e.Form.Controls("状态")
End If
Dim txt As String
If QQClient.Ready
If QQClient.UnreadCount > 0 Then
txt = "(" & QQClient.UnreadCount & "条)"
End If
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
End If
End If