Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigation between forms

Status
Not open for further replies.

Octagon6

Programmer
Mar 18, 2003
18
US
Dumb question... How do I switch from one form to the next?
 
Look @ the "Do Form" command


Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
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
 
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' :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top