Keeping a User-Defined Menu Active and on the Screen

Last reviewed: April 17, 1995
Article ID: Q98922
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, and 2.5a

SUMMARY

When you use the DEFINE MENU and ACTIVATE MENU commands to display a user- defined menu, the menu bar will disappear from the screen if you press the ESC key or use the mouse to click on an empty part of the screen. Putting the ACTIVATE MENU command inside a loop will keep the menu from deactivating. This is especially useful for FoxPro versions 1.x.

Below is a sample program that demonstrates how to activate a menu in a loop.

MORE INFORMATION

This example will keep the menu called "main" active at all times until the variable called "x" is equal to false, at which time the menu is deactivated.

   ****Program example****
   SET SYSMENU OFF
   x=.t.
   DEFINE MENU main
   DEFINE PAD option OF main PROMPT 'Option' at 1,1

   ON SELECTION PAD option OF main DO stopit

   DO WHILE x
     ACTIVATE MENU main
   ENDDO

   PROCEDURE stopit
   x=.f.
   DEACTIVATE MENU main


Additional reference words: FoxDos 1.02 2.00 2.50 2.50a popup
KBCategory: kbprg kbcode
KBSubcategory:


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 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.