Foxtable(狐表)用户栏目专家坐堂 → [求助]模仿显示OpenQQ的未读消息怎么就出错呢?


  共有2459人关注过本帖树形打印复制链接

主题:[求助]模仿显示OpenQQ的未读消息怎么就出错呢?

帅哥哟,离线,有人找我吗?
新福星
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1959 积分:15526 威望:0 精华:0 注册:2011/7/16 20:59:00
[求助]模仿显示OpenQQ的未读消息怎么就出错呢?  发帖心情 Post By:2015/11/4 16:36:00 [只看该作者]

'此段代码用于显示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
    If QQClient.UnreadCount > 0 Then
        txt = "(" & QQClient.UnreadCount & "条)"
    End If
End If
If OpenQQ.Text <> txt Then
    OpenQQ.Text ="OpenQQ" & txt
End If
If OpenQQ.Text > "" And  OpenQQ.Text <> "OpenQQ" 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
上段是示例文件给的;
‘///////////////////////////////////
Static jlxx As RibbonMenu.Button
Static LastTime1 As Date
If jlxx Is Nothing Then
    jlxx= ConfigBar.Items("交流信息")
End If
txt = "(" & DataTables("交流信息").SQLCompute("Count(接收人)","已处理=0 And 接收人='" & _Userbm & "." & _username & "'") & "条)"
If jlxx.Text <> txt Then
    jlxx.Text ="交流信息" & txt
End If

If jlxx.Text > "" And  jlxx.Text <> "交流信息" Then
    Dim ntp As timeSpan = Date.Now - LastTime1
    If ntp.TotalSeconds >= 0.5 Then
        LastTime1 = Date.Now
        If jlxx.ForeColor = Color.Red Then
            jlxx.ForeColor = Color.Transparent
        Else
            jlxx.ForeColor = Color.Red
        End If
    End If
End If
这是我模仿的。在配置栏中已经加入了 《交流信息》这个菜单项,出错!

图片点击可在新窗口打开查看此主题相关图片如下:ccc.jpg
图片点击可在新窗口打开查看

问题出在哪呢?谢谢


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/11/4 16:38:00 [只看该作者]

你的这个菜单 交流信息 不是button 而是 MenuButton

 

代码要这样写

 

Static jlxx As RibbonMenu.MenuButton

 


 回到顶部
帅哥哟,离线,有人找我吗?
新福星
  3楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1959 积分:15526 威望:0 精华:0 注册:2011/7/16 20:59:00
  发帖心情 Post By:2015/11/4 16:45:00 [只看该作者]

示例为什么可以写成Static OpenQQ As RibbonMenu.Button?

 回到顶部
帅哥哟,离线,有人找我吗?
新福星
  4楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:八尾狐 帖子:1959 积分:15526 威望:0 精华:0 注册:2011/7/16 20:59:00
  发帖心情 Post By:2015/11/4 16:50:00 [只看该作者]

弄好了 谢谢

 回到顶部