How the Menu Font Is Determined in FoxPro for Windows

Last reviewed: April 29, 1996
Article ID: Q103601
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SUMMARY

User-defined menus that are not created as a part of _msysmenu will be displayed in the MS Sans Serif font unless the current output window's font is FoxFont, in which case FoxFont will be used.

Below are three code examples that demonstrate this behavior and one example related to cross-platform applications.

Menus that are created as part of _msysmenu will always be displayed in MS Sans Serif; for example:

   DEFINE PAD test OF _msysmenu PROMPT "Test"
   ON PAD test OF _msysmenu ACTIVATE POPUP test

   DEFINE POPUP test

   FOR CNT = 1 TO 10
      DEFINE BAR CNT OF test PROMPT "test" + LTRIM(STR(CNT))
   ENDFOR

MORE INFORMATION

Sample 1

   DEFINE MENU test
   DEFINE PAD mypad OF test PROMPT "My Pad"
   ON PAD mypad OF test ACTIVATE POPUP test

   DEFINE POPUP test
   FOR CNT = 1 TO 10
      DEFINE BAR CNT OF test PROMPT "test" + LTRIM(STR(CNT))
   ENDFOR

   ACTIVATE MENU test NOWAIT

Sample 2

   DO WHILE .T.
      @ 2,2 PROMPT "test1"
      @ 2,12 PROMPT "test2"
      MENU TO x
   ENDDO

Sample 3

   DIMENSION arr(10)

   FOR CNT = 1 TO 10
      arr(CNT) = "test" + LTRIM(STR(CNT))
   ENDFOR

   @ 2,2 MENU arr,10
   READ MENU TO VAR

Cross-Platform Applications

If you are developing applications that are to be run on both the MS-DOS and Windows platforms using the same code but without using platform-specific conditional statements, set the output window to FoxFont to ensure portability.

If you are using platform-specific statements, the following code fragment shows the best way to handle these:

   IF _WINDOWS
      Do Windows-specific commands
   ELSE
      Do MS-DOS -specific commands
   ENDIF


Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a
KBCategory: kbprg 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 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.