Re: thisform.visible




"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
-----------------------------------------------------------


.



Relevant Pages

  • Re: Displaying a non-modal form
    ... > non-modal form called Notification form, but I could not do it in VB ... > I get the Error 401 but as all might have noticed in Microsoft Outlook ... > you are watching a modal form for instance the Option dialog box, ... Call it passing certain pieces of info and it will display the form for you? ...
    (microsoft.public.vb.general.discussion)
  • Re: Display Modal Form but Still Process from Parent Form?
    ... How does the modal form close? ... The panel can cover all your other UI elements if you don't ... I would like Form A to display a "Waiting..." ... > 2) Prevents me from having to disable controls on Form A until the ...
    (microsoft.public.dotnet.framework.compactframework)
  • ActiveX Control, Displaying modeless form -- Error 401
    ... I know you can't display a modeless form when a modal form is ... I created an activeX ... error 401 "can't show non modal form, ... parent application to loose focus. ...
    (microsoft.public.vb.general.discussion)
  • Re: Update table from another table...
    ... display the modal form, and then suddenly you are talking about not ... Student Name ... there are two ways to get rid of a modal form. ... Is this also a top-level form? ...
    (microsoft.public.fox.vfp.forms)
  • thisform.visible
    ... I have a modal form that is displayed by another form. ... line in the load event of the modal form it ... will not display unless there is a debugger breakpoint in the init event ...
    (microsoft.public.fox.programmer.exchange)

Quantcast