以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  QQClient  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=89052)

--  作者:武汉老杨
--  发布时间:2016/8/14 23:25:00
--  QQClient
如帮助中,http://www.foxtable.com/webhelp/scr/3012.htm

在菜单中提示新消息:

是否可以将 消息 按钮(offline) 不放在配置栏中,而是放在主窗口 中?

如果可以的话:

\'此段代码用于显示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

这段代码在哪里写?  该怎么更改?


谢谢!


--  作者:狐狸爸爸
--  发布时间:2016/8/15 8:16:00
--  

Static OpenQQ As WinForm.Label
Static LastTime As Date
If OpenQQ Is Nothing Then
    OpenQQ = Forms("窗口名").Controls("Label1")
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


--  作者:武汉老杨
--  发布时间:2016/8/15 13:19:00
--  
谢谢!

在窗口的 Timertick  中 加入如下代码:
Static OpenQQ As WinForm.button
Static LastTime As Date
If OpenQQ Is Nothing Then
    OpenQQ = Forms("主窗口").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

能显示 消息的条数,  但并没有闪烁。  我在该事件下还有一段切换背景代码如下:
Static i As Integer
If i = 0 Then
   i = 1
End If
 
e.Form.baseform.controls("主窗口").backgroundimage=getimage("G:\\foxtable\\管理项目1\\Images\\图片\\" & i & ".jpg")

i = i + 1
If i = 64 Then
  i = 1
End If


是不是两者有冲突,只有当背景(背景30秒切换) 切换时,才更新消息的条数。怎么更改才不冲突?

另: 在OpenQQ客户端事件Connected事件代码设置为:

Forms("主窗口").Controls("OpenQQ").SmallImage = GetImage("online.ico")

好像也由问题,图片的颜色不变哦!


请教狐爸,哪里有问题?







--  作者:Hyphen
--  发布时间:2016/8/15 15:10:00
--  
1、把计时器间隔改为1000,下面代码改为

Static count As Integer
Static i As Integer

If count = 30 Then
    count = 1
    If i = 0 Then
        i = 1
    End If
    
    e.Form.baseform.controls("主窗口").backgroundimage=getimage("G:\\foxtable\\管理项目1\\Images\\图片\\" & i & ".jpg")
    
    i = i + 1
    If i = 64 Then
        i = 1
    End If
Else
    count += 1
End If

2、项目images目录有"online.ico"这个文件吗

--  作者:武汉老杨
--  发布时间:2016/8/16 17:26:00
--  
谢谢!

项目images目录有"online.ico"这个文件。  

OpenQQ客户端事件Connected事件代码为:Forms("主窗口").Controls("OpenQQ").SmallImage = GetImage("online.ico")

图片的颜色还是不变,是不是这个代码写得有问题?   老是提示 没有 Smallimage .
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160816172005.png
图片点击可在新窗口打开查看




--  作者:大红袍
--  发布时间:2016/8/16 17:37:00
--  

代码改成

 

 

[此贴子已经被作者于2016/8/16 17:40:59编辑过]

--  作者:大红袍
--  发布时间:2016/8/16 17:42:00
--  

你 OpenQQ 控件,如果是图片控件,代码改成

 

Forms("主窗口").Controls("OpenQQ").Image = GetImage(ProjectPath & "Images/online.ico")


--  作者:武汉老杨
--  发布时间:2016/8/16 18:44:00
--  
谢谢!  

解决了!