如果想运行一段程序期间弹出写有“请稍等”的表单,运行完成后“请稍等”自动消失,怎么写?
如果想运行一段程序期间弹出写有“请稍等”的表单,运行完成后“请稍等”自动消失,怎么写?(1)在主表单,点击按钮,Click触发一个prg.
(2)prg运行的开始阶段,弹出一个表单,上面写“请等候”
(3)继续运行 prg的程序主体
(4)程序主体运行完成后,“请等候”表单自动消失,回到主表单。
[此贴子已经被作者于2016-3-30 20:36编辑过]
** test.prg of = CREATEOBJECT("form1") of.show READ EVENTS CLEAR ALL RETURN DEFINE CLASS form1 as Form ShowWindow = 2 Top = 200 Left = 300 ADD OBJECT cmd1 as commandbutton WITH top=10,left=10,caption="Test" ADD OBJECT edit1 as editbox WITH top=40,left=10,height=200 PROCEDURE cmd1.click LOCAL of2 of2 = CREATEOBJECT("form2") of2.show FOR i = 1 TO 10 of2.ddProgress = i/10 thisform.edit1.SelText = TRANSFORM(i)+0h0D0A INKEY(1) ENDFOR *IF VARTYPE(of2) == "O" * of2.release *ENDIF ENDPROC PROCEDURE Unload CLEAR EVENTS ENDPROC ENDDEFINE DEFINE CLASS form2 as Form ShowWindow = 1 DeskTop = .T. AutoCenter = .T. Width = 300 Height = 100 ddProgress = 0 ADD OBJECT label1 as label WITH top=20,left=20,autosize=.T.,caption="请稍等......" ADD OBJECT Shape1 AS Shape WITH top=50,left=20,height=25,width=this.Width-40 ADD OBJECT Shape2 AS Shape WITH top=50,left=20,height=25,Width=0,BackColor=0xFA9632,BorderStyle=0 FUNCTION ddProgress_Assign(vNewVal) IF BETWEEN(vNewVal, 0, 1) this.Shape2.Width = this.Shape1.Width * vNewVal ENDIF ENDFUNC ENDDEFINE