Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculation for size of VFP Desktop area?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00723216
Message ID:
00723259
Views:
18
Sorry, left out that I was using VFP 6.0 (not by personal choice).

So, it's my understanding that _Screen.Height and _Screen.Width is the height and width of the window containing the VFP desktop (including title bars, menus, status bar and area for forms to appear in). I would need to subtract from that the Title Bar and Menu Bar size (38) and the Status Bar size (23, which I have turned on in my application). I don't use toolbars in this application, so that does not need to be subtracted.

so ...

desktop_height = _Screen.Height - 38 - 23

Does this sound right???


Someone else in another forum suggested ViewPortHeight, but _Screen.Height and _Screen.ViewPortHeight kept returning the same numbers in the following test code:
***************************************************************************************
Set Status Bar On
Set SysMenu On
Show Window Standard

? "Menu", "Toolbar", "Status Bar", "Height", "ViewPortHeight"
Do Disp_Stat
Set SysMenu Off
Do Disp_Stat
Hide Window Standard
Do Disp_Stat
Set Status Bar Off
Do Disp_Stat

********************************************

Set Status Bar On
Set SysMenu On
Show Window Standard

********************************************

Procedure Disp_Stat
? Set("SysMenu"), IIF(WVisible("Standard"),"Shown","Hidden"), Set("Status Bar"), _screen.height, _screen.viewportheight
EndProc
***************************************************************************************

James



>>Does anyone have (or know of) a formula/calculation to determine the height and width of the VFP Desktop area. This would be the space below the menu bar (if any) and above the status bar (if turned on).
>>
>>I know SYSMETRIC() could be used to help calculate this, but I'm not sure of everything to include. I also know that _Screen.Height and _Screen.Width will help, but this is the size of the whole desktop (including title bar, menu bar, status bar, etc.)
>>
>>REASON: My application allows the users to adjust the height of some forms inside the application. The application saves these sizes and uses them the next time the form is opened. I also do the same for the desktop (_screen). If the user shrinks the desktop to it's minimum size (that I allow) or changes screen resolution (users! ), then the form could extend past the size of the desktop. I want to know what space I have so that I can make the sizing of the form smarter, shrink it automatically when necessary.
>>
>>Thanks in advance,
>>James Jernigan
>>Nashville, TN USA
>>jrjernigan@hotmail.com
>
>What version of VFP? In 7.0 _SCREEN.Height and .Width specifically refer to the desktop (white area usually) and adjusts if toolbars are docked or undocked and does not include the menu bar or title text.
=======================
J Robert Jernigan
Calabasas, CA USA
jrjernigan@hotmail.com

"To err is human ... I should know, I get to show my humanity everyday!" jrj

"I just love the internet - it takes this great big planet and makes it smaller. Now, why can't we all just get along?" jrj
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform