Microsoft KB Archive/165408

= How To Append Menu to an Existing Top-Level Form Menu =

Article ID: 165408

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q165408



SUMMARY
This article describes how you can append a menu to an existing Top-Level Form menu.



MORE INFORMATION
In order to do this correctly, you need to check APPEND in the Location option of the General Options dialog box in the Menu Designer. When running the menu to be appended, you need to pass it the name of the existing Top- Level Form in which it is to be appended.

The following example shows you how you can create an append menu to an existing Top-Level Form menu.  Create a menu. Type in Test1 and Test2 for menu pad names. Click General Options from the View menu. Select the Top-Level Form check box in the General Options dialog box. Generate the menu and save it as Menu1.mnx. Create a second menu. Type in Test3 for the menu pad name. Click General Options from the View menu. Select the Append option for Location and the Top-Level Form check box in the General Options dialog box.</li> Generate the menu and save it as Menu2.mnx.</li> Create a form and name it Appform1.scx.</li> Set the ShowWindow property for the form to "2 - As Top-Level Form" in the Properties window.</li> Add two command buttons to the form and name them Button1 and Button2.</li>  In the Click event of Button1, type in the following code: DO menu1.mpr WITH THISFORM, .T. </li>  In the Click event of Button2, type in the following code: DO menu2.mpr WITH THISFORM, THISFORM.NAME && The append will not work without the second parameter. </li> Run the form and choose Button1, and then Button2.</li></ol>

NOTE: Button1 makes the first menu appear, and button2 appends the second menu to the end of the first menu.

Keywords: kbhowto kbbuilder KB165408

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.