SystemIdle
在系统空闲的时候执行。
此事件执行较为频繁,所以请不要出现"负荷"较重的代码。
示例一
例如为了在状态栏显示用户名、表名、总行数、当前行位置,可以在SystemIdle中加入下面的代码:
With CurrentTable
Dim Str1 As String = "用户: " & User.Name
Str1 = Str1 & " 表名: " & .Name & " 总行数: "
Str1 = Str1 & .Rows.Count & " 当前行: " & (.Position + 1)
StatusBar.Message1 = Str1
End With
示例二
如果用户30秒内没有进行任何操作,就自动关闭系统,可以在SystemIdle中加入下面的代码:
If LastInputTickCount > 30000 Then
Syscmd.Project.Exit()
End If
提示:LastInputTickCount是一个系统变量,返回距离用户上次操作之后的时间,单位为毫秒。
本页地址:http://www.foxtable.com/webhelp/topics/0665.htm