以下是引用不懂才问在2015-12-8 12:07:57的发言:
我在main.prg里 声明一个公共类 里面有clear events
我在main.prg里 声明一个公共类 里面有clear events
共性与个性最好能明确清晰一点。
如:
程序代码:
blLogin = .F. loginForm = CREATEOBJECT("logForm") loginForm.show READ EVENTS IF !blLogin MESSAGEBOX("登录失败","提示") IF _VFP.StartMode == 4 QUIT ELSE CLEAR ALL RETURN ENDIF ENDIF 主程序() CLEAR ALL PROCEDURE 主程序 MESSAGEBOX("主程序") ENDPROC DEFINE CLASS logForm as FormShow2 caption="欢迎登录材料管理系统" autoCenter=.t. width=300 height=200 titleBar=0 picture="登录背景.bmp" icon="logo.ico" controlBox=.f. ADD OBJECT cmdOk as BtnBase WITH top=168,left=160,height=25,width=60,caption="确 定" ADD OBJECT cmdCancel as exitBtn WITH top=168,left=228,height=25,width=60,caption="取 消" PROCEDURE cmdOk.Click blLogin = .T. thisform.Release ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC ENDDEFINE DEFINE CLASS FormShow2 as FormBase ShowWindow = 2 * add user code here ENDDEFINE DEFINE CLASS FormShow1 as FormBase ShowWindow = 1 * add user code here ENDDEFINE DEFINE CLASS FormBase as Form * add user code here ENDDEFINE DEFINE CLASS exitBtn as BtnBase PROCEDURE click RELEASE thisform ENDPROC ENDDEFINE DEFINE CLASS BtnBase as CommandButton * add user code here ENDDEFINE
[此贴子已经被作者于2015-12-8 21:09编辑过]