Using Multiple Screen Resolutions in FoxPro for Windows

Last reviewed: April 30, 1996
Article ID: Q114668
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6

SUMMARY

While the ability to provide graphical screens in FoxPro for Windows applications can enhance appearance of the interface, using these screens may also require additional coding to handle differences in monitor resolutions. Below is one method of handling this situation that uses separate screens created under each of the potential screen resolutions.

MORE INFORMATION

This method is best suited to applications that use a minimal number of screens. For large numbers of screens, we recommend that they all be created under the lowest resolution to ensure that they will be visible at higher resolutions.

This example assumes that standard VGA and super VGA (SVGA) are the only two resolutions under which the application will be run. Two .SPR files, named LO_RES.SPR and HI_RES.SPR, have been created under VGA and SVGA, respectively.

To have a program automatically call the proper .SPR file, include the following command in the program:

   DO (IIF(SYSMETRIC(1)=640,'LO','HI')+'_RES.SPR')

The SYSMETRIC(1) function returns the width of the current screen resolution, which is tested against 640 to see if the resolution is VGA. If so, "LO" is concatenated to "_RES.SPR", and the LO_RES.SPR file is then executed. If the resolution is not VGA, the HI_RES.SPR file is executed instead.


Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a 2.50b 2.60 font
conditional
off
video resolution design
KBCategory: kbprg kbui kbgraphic kbcode
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.