Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refer to top level form from child form
Message
From
14/03/2002 19:37:11
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00633056
Message ID:
00633170
Views:
23
Well, it would have helped if you had answered my question(s). You are using a contradiction of terms. A top level form is an SDI application. An MDI application is running a standard VFP application where you have multiple documents but there is only a single entry in the windows taskbar.

>how do I reference the top-level form so I can set properties of it - trigger methods etc...

Like I said, where are you trying to reference the top level form from? Is it from a child form launched from the top level form? I'll assume this to be the case.

You launch your child form from your top level form. The child form is a VCX based form that is created using CreateObject()

The SDI (top level) form is frmDesktop. From which ever method you launch your child form, it should look something like this.
local oChild
oChild = createobject('frmChild', thisform)
In the init event of frmChild, you have a parameter that receives the object reference of the calling form (the second argument of the above call).

In the child form, you have a property called, say, oCaller. In the init of the child, you would say something like :-
FUNCTION Init(toCaller)
this.oCaller = m.toCaller
Now, when the init goes out of scope, the calling form's object reference is stored to the child form's property oCaller.

So, the manipulate methods/properties in the calling form (frmDesktop) from the child form frmChild, you simply state something like :-

thisform.oCaller.MethodYouWantInTheCallingForm()
thisform.oCaller.PropertyToSetInTheCallingForm = "Whatever"

My Wife is calling so, I am going to bed now <s>. HTH

-=Gary
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform