Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining the name of the top level form
Message
From
27/04/2000 14:21:08
 
 
To
27/04/2000 13:43:46
James Marshall
SPAWAR Systems Center Charleston NCR
Washington, District of Columbia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00364196
Message ID:
00364212
Views:
13
>Hope someone can help me here. I know enough to be dangerous, as they say. Here's my question:
>
>I'm taking my first stab at a top level form application, rather than the "In Screen (Default)" type. I'm playing around with dynamically resizing (the file examples and the Jan 99 issue of FoxproAdvisor were very helpful, thanks). I'm trying to find the right command for determining the name of the top level form, from within the application. I tried using _SCREEN, _VFP, and APPLICATION, but no joy. So far, I'm able to get it by using the following code:
>
>
>FOR EACH oForm IN APPLICATION.FORMS
>  IF oForm.ShowWindow = 2
>    oTLFName=oForm
>    EXIT
>  ENDIF
>ENDFOR
>
>IF TYPE("oTLFName")="O"
>   * I can now refer to it's properties, i.e., oTLFName.Height
>ELSE
>   * ShowWindow property is set to either 0 or 1
>ENDIF
>
>
>Is there a cleaner method of accessing TLF properties? I know that I could simply hard code the name, but I would like to create a class from this, if feasible. Thanks in advance...

You can start your top-level form as:
DO form topform name oApp.topform linked

oApp.topform is custom property of application object.
Then you can always call its PEMS as:
oApp.topform.property1=...
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform