Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Top-Level Form Menu Presence
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00196872
Message ID:
00197586
Views:
18
>>Well, I didn't get a single response so I'm reposting cause I know someone's got to have an answer for this. :-)
>>
>>How can you programmatically determine if a top-level form has a menu instantiated in it?
>>
>>Thanks,
>>Bill
>
>Hi Bill,
>
>You could calculate it. The values in the property sheet refer to the client area of the form (excludes frame size and title bar). However, using Foxtools you can get the height of the actual window. If the client area is less than the overall form height - (titlebar height + (2 * the frame height)), the form has a menu. Here's the code:
>* Foxtools must be loaded
>* Init code
>STORE 0 TO lnTop, lnLeft, lnBottom, lnRight, lnhWnd, lnheight
>llhasmenu = .F.
>lnhWnd = _WhTohWnd(_WFindTitl(This.Caption))
>= _GetWRect(lnHwnd, @lnTop, @lnLeft, @lnBottom, @lnRight)
>lnheight = lnBottom - lnTop
>* Assumes frame is sizable
>llhasmenu = This.Hieght < (lnheight - (SYSMETIRC(9) + (2 * SYSMETRIC(4))))
>How's that?

Hi George, how are you doing? Has it been cold enough for you? :-)

Thanks for the info. I'll look at this and maybe replace my developer-set property with it.

Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform