Sample Menu with BROWSE, AND SET DEFAULT

Last reviewed: August 16, 1995
Article ID: Q128537
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6, 2.6a

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


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