Sample Menu with BROWSE, AND SET DEFAULT

ID: Q128537

The information in this article applies to:

SUMMARY

This article shows by example how to create a menu that has an option to perform the SET DEFAULT command and an additional option to perform the BROWSE command so that the BROWSE is executed instead of the default BROWSE LAST command. The example below shows how to do this.

MORE INFORMATION

1. Create a quick menu:

   a. From the File menu, choose New. Then choose Menu, and click OK.
   b. In the Menu dialog, select the Quick Menu option.

2. Create a menu item under File with this prompt:

   Set Default

3. Choose Command, and type:

   SET DEFAULT TO GETDIR()

4. Change the prompt under Database labeled BROWSE to:

   BROWSE LAST

5. Create a separate menu item under Database labeled:

   BROWSE

6. Choose Command and type:

   BROWSE

7. Save the menu.

8. From the Program menu, choose Generate, and name it MYMENU.MPR.

9. Add the following line to the CONFIG.FPW file:

   COMMAND=DO MYMENU.MPR

10. Exit, and restart FoxPro. The new menu should be running.

11. To return to the default FoxPro menu, issue the following command from

    the Command window:

    SET SYSMENU TO DEFAULT

WARNING: If you are creating .EXE files and running them from outside FoxPro, this menu could cause the application to flash up on the screen, and just go away if the same CONFIG.FPW is being used for multiple applications. Remark out the following line or make sure another CONFIG.FPW file is being used by the other .EXE files:

   COMMAND=DO MYMENU.MPR

REFERENCES

See Chapter 3 of the "FoxPro for Windows Developer's Guide" for more Information on the creation of Menus in FoxPro using the Menu Generator.

For more information about the topics discussed in this article, please see the following articles in the Microsoft Knowledge Base:

ARTICLE-ID: Q87694

TITLE     : PRB: Menu Appears, then Application Exits to Operating System

Additional reference words: FoxWin 2.50 2.50a 2.50b 2.60 2.60a custom preference KBCategory: kbtool KBSubcategory: FxtoolMbuilder

Last Reviewed: August 16, 1995