MyForm = CREATEOBJECT('MyForm') && Create a Form MyForm.Show() DO WHILE TYPE('Myform.Caption')="C" READ EVENTS ENDDO RETURN ************************************************** *-- Class: myform (c:\profiler\progs\myforms.vcx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 03/25/03 04:52:03 PM * DEFINE CLASS myform AS form DoCreate = .T. Caption = "Myform" WindowType = 1 Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 96, ; Left = 103, ; Height = 27, ; Width = 168, ; Caption = "Toggle Closable Property", ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 152, ; Left = 103, ; Height = 54, ; Width = 168, ; WordWrap = .T., ; Caption = "Run MyForm2 and Change this form to closable=.F. while it is running", ; Name = "Command2" PROCEDURE command1.Click wait WINDOW "changing closable property" nowait IF thisform.closable=.T. thisform.closable=.F. ELSE thisform.closable=.T. ENDIF ENDPROC PROCEDURE command2.Click thisform.closable=.F. MyForm2 = CREATEOBJECT('MyForm2') && Create a Form MyForm2.Show() DO WHILE TYPE('Myform2.Caption')="C" READ EVENTS ENDDO thisform.closable=.T. ENDPROC ENDDEFINE * *-- EndDefine: myform ************************************************** ************************************************** *-- Class: myform2 (c:\profiler\progs\myform.vcx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 03/25/03 04:58:14 PM * DEFINE CLASS myform2 AS form Top = 45 Left = 45 DoCreate = .T. Caption = "Myform2" WindowType = 1 Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 96, ; Left = 103, ; Height = 27, ; Width = 168, ; Caption = "Toggle Closable Property", ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 144, ; Left = 102, ; Height = 27, ; Width = 168, ; Caption = "Close", ; Name = "Command2" PROCEDURE command1.Click wait WINDOW "changing closable property on Myform" nowait IF TYPE('Myform.Caption')="C" IF myform.closable=.T. Myform.closable = .F. ELSE Myform.closable = .T. ENDIF ENDIF ENDPROC PROCEDURE command2.Click thisform.release() ENDPROC ENDDEFINE * *-- EndDefine: myform2 **************************************************