Re: thisform.visible
- From: "Stefan Wuebbe" <stefan.wuebbe@xxxxxx>
- Date: Thu, 22 Nov 2007 11:05:13 +0100
"Peter Huish" <huish@xxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:MPG.21afae186a8e168e9896d8@xxxxxxxxxxxxxxxxxxxx
I have a modal form that is displayed by another form. If I do not have
a thisform.visible = .f. line in the load event of the modal form it
will not display unless there is a debugger breakpoint in the init event
of the model form.
How do you exactly start the form, is it an SCX or a class in a VCX?
I do not have an explicit assignment of thisform.visible to .t. in my
modal form however in the designer the property's value is .t.
That's ok, form.Visible is affected at runtime automatically -
that is, it depends on the way you instantiate the form.
Quite complicated actually:
If for example you use the Do Form command, the VFP runtime
instantiates the object and then sets Visible=.T. in the Show() pseudo
event. IOW,
Do Form yourModalForm.SCX
gives an internal event sequence of form Load, Init, Show, (Activate,
GotFocus)
On the other hand, when you use the NoShow clause of the Do Form
command or wehn you use New/CreateObject() with a VCX class,
then Show() is not an event anymore and must be called explicitly
in your code (in that case it does not matter at all if you have set the
WindowType property to be modal or modeless).
However, that all leads to the "gotcha" that you must not do anything
which might set the form visible *before the Init is over -
e.g. you'll need to avoid stuff like "Thisform.Refresh()" or even
Thisform.someControl.SetFocus()" in or before Thisform.Init()
So, in the load routine of the modal form what is Thisform referencing?
Is the the calling form?
No, "Thisform" is always .... ahm, "this form" :-)
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
.
- Follow-Ups:
- Re: thisform.visible
- From: Peter Huish
- Re: thisform.visible
- References:
- thisform.visible
- From: Peter Huish
- thisform.visible
- Prev by Date: Re: System Tray Class
- Next by Date: When Do I Need a Server Back End?
- Previous by thread: thisform.visible
- Next by thread: Re: thisform.visible
- Index(es):
Relevant Pages
|