Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show(1) does not hold
Message
 
 
To
23/08/2004 14:36:27
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00935656
Message ID:
00935685
Views:
27
>Hi Mark, that worked only if I set my ShowWindow = 0 (in screen default). I had the main form as a top level and the others with a ShowWindow of 1 in top level.
>
>Anyway, I will just revert to the default behavior and all should work again and I can stop banging my head against the desk...:>)

Put the following code in a project, build an EXE, then run it. It is slightly different than what you are doing, but I see no reason not to be able to Show a form and make it modal on the fly. If you do not want the VFP _screen to show, compile in a CONFIG.FPW that SCREEN=OFF in it.
SET TALK OFF
oTop = CREATEOBJECT('_tlForm')
oTop.Visible = .T.
oModal = CREATEOBJECT('_ui_form')
oModal.Show(1)
IF TYPE('oModal') = 'O' AND NOT ISNULL(oModal)
	oModal.Release()
ENDIF
RELEASE oModal
oTop.Release()
QUIT

DEFINE CLASS _ui_form as form

	ShowWindow = 1
	Height = 300
	Width = 400
	AutoCenter = .T.

	ADD OBJECT cmdExit AS CommandButton WITH ;
		TOP = 200, ;
		LEFT = 150, ;
		HEIGHT = 30, ;
		WIDTH = 100, ;
		FONTSIZE = 18, ;
		CAPTION = 'E\<xit', ;
		DEFAULT = .T.

	PROCEDURE Init
		SET TALK OFF
	ENDPROC
	PROCEDURE cmdExit.Click
		THISFORM.Release()
	ENDPROC

ENDDEFINE
DEFINE CLASS _tlform AS form

	ShowWindow = 2		&& top level form
	Height = 500
	Width = 500
	AutoCenter = .T.

	PROCEDURE Init
		SET TALK OFF
	ENDPROC
ENDDEFINE
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform