谢谢蓝老师,改好了,下线变色了
![dvubb 图片点击可在新窗口打开查看](images/emot/em68.gif)
不知道下面这个
显示未读新消息数量还能改吗,我试着改总报错
3、假定这个新增按钮名称为"OpenQQ",在菜单的SystemIdle事件增加以下代码:
'此段代码用于显示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
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
上面代码利用新增加的按钮标题显示未读新消息数量,并每隔0.5秒切换按钮的字体颜色,形成闪烁效果,以提示用户有新消息。
通过这段代码,你还可以学到一招: 定期执行某项任务,并非一定要通过计划或定时器,望认真体会。