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

Calling Modal Form on Top Level Form 1

Status
Not open for further replies.

TariqMehmod

Programmer
Mar 4, 2004
100
PK
Respected Tek-Tipsers

I have 2 forms.
The first one is a TOP LEVEL FORM and the second is a MODAL FORM.

I run Form1 and then call Modal Form with command

Code:
 DO excel_griff
This a prg based form.

But form does not appear.

I have following codes in config.fpw files

Code:
 SCREEN=OFF
HELP=OFF
RESOURCE=OFF
TALK=OFF
MULTILOCKS=ON
SAFETY=OFF
TMPFILES=c:\windows\temp
EDITWORK=c:\windows\temp]


How it is possible to show MODAL Form with TOP LEVEL FORM?

Forms and other files are in attachment.

Please



 
 https://files.engineering.com/getfile.aspx?folder=75cf5ecf-0bb8-45e7-9e90-9416aa6bdbad&file=Modal_Form.zip
Hi Tariq,

there is a form property called .ShowWindow. The default setting for VFP default forms is 0 - In Screen (Default).
This is OK as long as your _Screen is visible and used.
As soon as you declare a form as 2 - TopLevelForm the form is independent from _Screen and can hold its own childforms.
If a childform is called from a TopLevelForm the childform automatically assumes it has to be shown within _Screen (as this is the default setting) but in that case this assumption is wrong as it has to be shown within the TopLevelForm. Therefore, the childforms ShowForm Property has to be set to 1-InTopLevelForm.

In your case, your childform was opened, but not in the TopLevelForm but in _Screen and as I assume, that _Screen is switched of, so you don't see it.

HTH

-Tom
 
Dear Sir's

I used following codes to run a MODAL Form on 2 - TopLevelForm

Code:
 * current positions
With _Screen
	oldScreenLeft=.Left
	oldScreenTop=.Top
	oldScreenHeight=.Height
	oldScreenWidth=.Width
	oldScreenColor = .BackColor
Endwith

* defien screen
With _Screen
	.Left = Thisform.Left
	.Top = Thisform.Top
	.Height = Thisform.Height-20
	.Width  = Thisform.Width-20
	.LockScreen=.T.
	.BorderStyle=0
	.Closable=.F.
	.MaxButton=.T.
	.MinButton=.T.
	.Movable=.F.
	.WindowType=1
	.AlwaysOnTop=.T.
	.AutoCenter=.T.
	.TitleBar=0
	.LockScreen=.F.
	ControlBox=.F.
	_Screen.Visible= .T.
Endwith

* run modal form
Do excel_mike
*----------------------

* codes to activate after modal form is released
With _Screen
	.Left = oldScreenLeft
	.Top = oldScreenTop
	.Height = oldScreenHeight
	.Width  = oldScreenWidth
	.BackColor=oldScreenColor

Endwith

_Screen.Visible= .F.

Now everything is OK.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top