Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation for size of VFP Desktop area?

Status
Not open for further replies.

jrjernigan

Programmer
Nov 12, 2002
12
US
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 [wink] <g>), 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
 
psalyer,
It's never a good idea to &quot;start&quot; a new thread on the end of another one (espcially on so old). Try starting a new thread with this question. Or start by doing a search on this topic - I'd try &quot;resize&quot;, &quot;form size&quot;, &quot;resolution&quot;, etc.

You have (at least) 4 choices:
1) Stop the user from using the application if they don't have at least 1024x768 resolution.
2) Create variants of all your forms smaller than 1024x768, and use sysmetric(1) & sysmetric(2) to decide which to use.
3) Change your form base class to support vertical and horizontal scrollbars to support lower resolutions.
4) Add resizing capabilies to your Form/control classes. The VFP Foundation classes supply one, most frameworks offer this option, and there are a number of freeware/shareware/commercial solutions to resizing.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top