以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- SystemIdle 事件会偶尔报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=193905) |
-- 作者:873773115 -- 发布时间:2024/10/24 14:55:00 -- SystemIdle 事件会偶尔报错 所有在用的客户端,只有两个客户端会偶尔报错,报错原因为 不存在名称为 "Main" 的窗口 但是,Main是主窗口,系统在运行的时候,这个窗口不可能关闭或者不存在,下面是报错事件的代码,老师帮忙看看有啥问题没 If Forms.Contains("Main") Then If QQClient.Ready Then If Forms("Main").Opened Then Dim OpenQQ As WinForm.Button = Forms("Main").Controls("OpenQQ") Static LastTime As Date Dim txt As String If QQClient.UnreadCount > 0 Then txt = "(" & QQClient.UnreadCount & "条)" 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 End If End If End If
|