以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]openqq  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=78145)

--  作者:zcgmxf
--  发布时间:2015/12/3 8:45:00
--  [求助]openqq

老师,openqq的消息提示如果设置在窗口,

If OpenQQ Is Nothing Then
    OpenQQ = ConfigBar.Items("OpenQQ")
End If

这条代码该怎么改:OpenQQ = ConfigBar.Items("OpenQQ")
请指点,谢谢!


--  作者:大红袍
--  发布时间:2015/12/3 9:16:00
--  

If OpenQQ Is Nothing Then
    OpenQQ = Forms("窗口1").Controls("TextBox1")

End If


--  作者:zcgmxf
--  发布时间:2015/12/3 15:50:00
--  

红袍老师,未读消息提示代码放在窗口 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编辑过]

--  作者:大红袍
--  发布时间:2015/12/3 16:07:00
--  

你放在timertick事件了吗?开启了吗?

 

http://www.foxtable.com/help/topics/1301.htm

 

放在timertick的话,可以简化一下的。

 

Static OpenQQ As winForm.Button
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
    If OpenQQ.ForeColor = Color.Red Then
        OpenQQ.ForeColor = Color.Transparent
    Else
        OpenQQ.ForeColor = Color.Red
    End If

End If


--  作者:zcgmxf
--  发布时间:2015/12/3 16:15:00
--  

我是放在timertick中的,我的意思是放在afterload中不闪烁,是不是下面的0.5秒执行一次的代码没有执行

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 16:16:17编辑过]

--  作者:大红袍
--  发布时间:2015/12/3 16:21:00
--  

有没有执行,你加入msgbox不就知道了?

 

看4楼,你要启动timertick才会触发事件啊