Keeping a User-Defined Menu Active and on the Screen

ID: Q98922

The information in this article applies to:

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:

Last Reviewed: April 17, 1995