Visual FoxPro 6.0 Sample: How to Create a Menu Object (259962)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q259962

SUMMARY

MenuObject.exe is a sample that demonstrates how to create a menu object in Visual FoxPro.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: May-24-2000

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The MenuObject.exe file contains the following files:

File nameSize
MenuObject.pjx2,493
MenuObject.pjt15,675
MenuClass.prg10,303
MenuObject.scx2,232
MenuObject.sct10,906
Program3.prg44
DoMenuForm.prg2,116
ReadMe.txt1,451

This example contains a project (MenuObject.pjx) that runs when a menu item is chosen. MenuObject.pjx contains a form (MenuObject.scx), a MenuClass class definition (MenuClass.prg), a Main program (DoMenuForm.prg), and a program (program3.prg).

Steps to Run the Sample

  1. Run the self-extracting executable file (MenuObject.exe) into a folder.
  2. In the Visual FoxPro Command window, run DoMenuForm. When the form is run, three menu pads are displayed on the system menu, Test1, Test2, and Test3.
  3. Select Enable Test2 menu pad to enable the Test2 menu pad.
  4. Select Add Option4 menu pad to the menu to add another Option4 menu pad to the system menu.
  5. Select Add Menu items to Option4 to add a menu item under the Option4 menu pad.
  6. Select Disable menu items under Sub-Test3-2-2 to disable the Sub-Test3-2-2 menu items in Test3 -> SubTest3-2 -> SubTest3-2-2.
  7. Select Disable menu item Sub-Test3-2-2 to disable menu item Sub-Test3-2-2.
  8. Select Change Caption Test3 to WhoIsThis to check the Test3 menu pad text to WhoIsThis.
  9. Select Test1 -> Exit or click the Exit button on the form to quit the program.
NOTE: The code provided in the sample does not contain any type of error checking routines. The code provided only demonstrates how to create a menu object wrapper.

Modification Type:MinorLast Reviewed:8/5/2004
Keywords:kbdownload kbfile kbSample kbXBase KB259962 kbAudDeveloper