Apr 22, 2003 #1 Octagon6 Programmer Mar 18, 2003 18 US Dumb question... How do I switch from one form to the next?
Apr 22, 2003 #2 EzLogic Programmer Aug 21, 2001 1,230 US Look @ the "Do Form" command Ali Koumaiha TeknoSoft Inc Farmington Hills, Michigan Upvote 0 Downvote
Apr 22, 2003 #3 rgbean Programmer Nov 9, 2000 5,707 US Do you want to switch between running forms or as Ali assumed, do you want to start another form? If the first, do you want to do this programatically, with the mouse or keyboard, or by way of a menu? Rick Upvote 0 Downvote
Do you want to switch between running forms or as Ali assumed, do you want to start another form? If the first, do you want to do this programatically, with the mouse or keyboard, or by way of a menu? Rick
Apr 22, 2003 #4 darrellblackhawk Programmer Aug 30, 2002 846 US You can use a form's show() method to make it active if you have a reference to it. Here's a convoluted example: oForm1 = CREATEOBJECT("MyForm" oForm2 = CREATEOBJECT("MyForm",oForm1) oForm3 = CREATEOBJECT("MyForm",oForm2) oForm3.oLinkedForm = oForm1 oForm3.cmdActivate.CAPTION = "Activate "+oForm1.NAME oForm2.oLinkedForm = oForm3 oForm2.cmdActivate.CAPTION = "Activate "+oForm3.NAME oForm1.oLinkedForm = oForm2 oForm1.cmdActivate.CAPTION = "Activate "+oForm2.NAME oForm3.show() oForm2.SHOW() oForm1.SHOW() READ EVENTS DEFINE CLASS MyForm AS FORM oLinkedForm = NULL HEIGHT = 100 WIDTH = 160 ADD OBJECT cmdActivate AS COMMANDBUTTON WITH; HEIGHT = 24, ; AUTOSIZE = .T., ; CAPTION = "" PROCEDURE INIT(loLinked) IF VARTYPE(loLinked) == "O" THIS.oLinkedForm = loLinked THIS.cmdActivate.CAPTION = "Activate "+loLinked.NAME this.left = loLinked.left + loLinked.width + 50 ENDIF ENDPROC PROCEDURE DESTROY CLEAR EVENTS ENDPROC PROCEDURE cmdActivate.CLICK IF VARTYPE(THISFORM.oLinkedForm) == "O" THISFORM.oLinkedForm.SHOW() ENDIF ENDPROC ENDDEFINE 'We all must do the hard bits so when we get bit we know where to bite' Upvote 0 Downvote
You can use a form's show() method to make it active if you have a reference to it. Here's a convoluted example: oForm1 = CREATEOBJECT("MyForm" oForm2 = CREATEOBJECT("MyForm",oForm1) oForm3 = CREATEOBJECT("MyForm",oForm2) oForm3.oLinkedForm = oForm1 oForm3.cmdActivate.CAPTION = "Activate "+oForm1.NAME oForm2.oLinkedForm = oForm3 oForm2.cmdActivate.CAPTION = "Activate "+oForm3.NAME oForm1.oLinkedForm = oForm2 oForm1.cmdActivate.CAPTION = "Activate "+oForm2.NAME oForm3.show() oForm2.SHOW() oForm1.SHOW() READ EVENTS DEFINE CLASS MyForm AS FORM oLinkedForm = NULL HEIGHT = 100 WIDTH = 160 ADD OBJECT cmdActivate AS COMMANDBUTTON WITH; HEIGHT = 24, ; AUTOSIZE = .T., ; CAPTION = "" PROCEDURE INIT(loLinked) IF VARTYPE(loLinked) == "O" THIS.oLinkedForm = loLinked THIS.cmdActivate.CAPTION = "Activate "+loLinked.NAME this.left = loLinked.left + loLinked.width + 50 ENDIF ENDPROC PROCEDURE DESTROY CLEAR EVENTS ENDPROC PROCEDURE cmdActivate.CLICK IF VARTYPE(THISFORM.oLinkedForm) == "O" THISFORM.oLinkedForm.SHOW() ENDIF ENDPROC ENDDEFINE 'We all must do the hard bits so when we get bit we know where to bite'