红袍老师,未读消息提示代码放在窗口 afterload怎么不闪烁,放在timertick中闪烁 按照设定间隔,不是0.5秒
'此段代码用于显示OpenQQ的未读消息
Static OpenQQ As winForm.Button
Static LastTime As Date
If OpenQQ Is Nothing Then
OpenQQ = Forms("窗口13").Controls("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
[此贴子已经被作者于2015/12/3 15:51:24编辑过]