_screen创建的timer在time事件里不能让它停下来吗?
在主程序里创建timer控件,想实现的是按下ctrl+alt+home组合键后,调用输入口令表单,输入正确后,打开系统菜单。但问题是,调用输入口令表彰后不能停下来,他会一直不停地出表单,设置了this.enabled=.f.和interval=0都停不下来。为什么?
程序代码:
Define Class Timer5 As Timer Top = 0 Left = 120 Height = 23 Width = 23 Interval = 700 Procedure Timer nlastkeynumb=Lastkey() If nLastkeynumb=151 .And. NetServerMenu this.Interval = 0 this.Enabled = .F. Public SysPwConVar1 , SysPwConVar , SysCyhPwVar SysPwConVar = 1 SysPwConVar1 = .F. SysCyhPwVar = '' Do Form 系统管理口令.scx with 1 Read Events If SysPwConVar1 = .T. SysCurUser = Substr(SysCyhPwVar,AT('>',SysCyhPwVar) + 1) SysCurKs = Substr(SysCyhPwVar,1,AT('—',SysCyhPwVar) - 1) _Screen.Height = 93 Set Sysmenu To Set Sysmenu On Do MenuServer.Prg NetServerMenu=.F. Endif release SysPwConVar1 , SysPwConVar , SysCyhPwVar this.Interval = 700 this.Enabled = .T. Endif If nLastkeynumb=159 .And. !NetServerMenu this.Enabled = .F. this.Interval = 0 Set Sysmenu To Set Sysmenu Off _Screen.Height = 72 NetServerMenu=.T. SysCurUser='' SysCurKs='' this.Interval = 700 this.Enabled = .T. Endif Enddefine