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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need for help with thisform.release()

Status
Not open for further replies.

tripp2222

Technical User
Nov 30, 2004
32
0
0
US
Hi,

I have a form called main that I am using to get to different forms (add or delete, display, print). The problem that I am having is when I click on the button to get to the next form I would like to have the main disappear. I know how to do it in Visual Basic, but I am having a bit of difficulty with VPF forms. I am really looking to learn VPF any help I truely would appreciate.
 
hi tripp2222
try this...

Thisform.Release
or
Thisform.name_of_my_form.release

:)
omr
 
Hi Tripp2222

If you want to link from MainForm tp form1 and get back to mainform and then link to form2 mainform etc.. then.. you cannot release mainform.

Make the all called forms modal.. i.e. WindowType=1 so that the users cannot click out and jump to mainform while formAdd or FormReport is being used. When they exit that form, main form will become accessible.

If you still want to hide the form... then try this example.. simply copy and run the code

Code:
PUBLIC oformmain

oformmain=NEWOBJECT("formmain")
oformmain.Show
RETURN


**************************************************
*-- Form:         formmain (e:\winners8\gl8\formmain.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   12/03/04 11:06:10 AM
*
DEFINE CLASS formmain AS form

	DoCreate = .T.
	Caption = "FormMain"
	Name = "FormMain"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 48, ;
		Left = 84, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Form1", ;
		Name = "Command1"

	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 96, ;
		Left = 84, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Form2", ;
		Name = "Command2"

	ADD OBJECT command3 AS commandbutton WITH ;
		Top = 144, ;
		Left = 84, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Exit", ;
		Name = "Command3"

	PROCEDURE command1.Click
		ThisForm.Hide()
                oForm = NEWOBJECT('form1')
                oForm.Caption = 'Form1'
		oForm.Show()
		ThisForm.Show()
	ENDPROC

	PROCEDURE command2.Click
		ThisForm.Hide()
                oForm = NEWOBJECT('form1')
                oForm.Caption = 'Form2'
		oForm.Show()
		ThisForm.Show()
	ENDPROC

	PROCEDURE command3.Click
		ThisForm.Release()
	ENDPROC

ENDDEFINE
*
*-- EndDefine: formmain
**************************************************
*
*
**************************************************
*-- Form:         form1 (e:\winners8\gl8\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   12/03/04 11:04:03 AM
*
DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	WindowType = 1
	Name = "Form1"

	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 156, ;
		Left = 48, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Exit", ;
		Name = "Command1"

	PROCEDURE command1.Click
		ThisForm.Release()
	ENDPROC

ENDDEFINE
*
*-- EndDefine: form1
**************************************************

____________________________________________
ramani - (Subramanian.G) :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top