请教各位大大,在systemidle 中设定的代码对动态产生的物件好像无效,不知有没人遇到
案例:OpenQQ于佩置栏动态生成,但systemidle中确对该蝴蝶没作用
此主题相关图片如下:ff.jpg
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