Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Main container - how to detect it?
Message
 
To
08/11/2003 20:06:35
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00848006
Message ID:
00848108
Views:
10
Hi Michel

What I did was create a function in the container and Page classes which did the following:

For containers:

Function GetMainContainer
Return This.Parent
EndFunc

For Pages:

Function GetMainContainer
Return This.Parent.Parent
EndFunc

Since my framework is based on presentation objects based on the container class I changed the function in this class to:

Function GetMainContainer
Return This
EndFunc

So to get a reference from any widget to the highest non-form container I simply do:

loContainer=This.Parent.GetMainContainer()

I use presentation object because they are not added to the form until it is activated so I can open a number of forms quickly.

Regards
Simon


>I remember having seen something in regards to that. Basically, from a text field control, I need to know if the main container is a toolbar or a form. What would be the easiest appraoch for that?
Simon White
dCipher Computing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform