Microsoft KB Archive/193783

= How To Use the _ShortCutMenu Foundation Class =

Article ID: 193783

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q193783



SUMMARY
This article describes how to create a shortcut menu using the _ShortCutMenu Foundation Class in the _menu.vcx class library.



MORE INFORMATION
The _ShortCutMenu Foundation Class allows you to bold, disable, and place a check mark next to the menu prompt.

The following example shows how to use the _ShortCutMenu Foundation Class:

 Create a form named Myshortmenu. Add the _ShortCutMenu class, located in the _menu.vcx, to the form. The _menu.vcx file resides in the Home\FFC folder. Create two custom properties for the form, lcheck, and lbold. Next, create a custom method, called Myproc, for the form.  In the RightClick event of the form, place the following code: PRIVATE oTHISForm oTHISFORM = Thisform Thisform._shortcutmenu1.ClearMenu

WITH Thisform._shortcutmenu1 .AddMenuBar("AAA",[wait window "AAA"]) .AddMenuSeparator .AddMenuBar("Check/UnCheck CCC",[oTHISFORM.myproc(prompt)]) .AddMenuBar("BBB",[wait window "BBB"]) .AddMenuBar("CCC",[wait window "CCC"],,,oTHISFORM.lcheck) .AddMenuBar("DDD",[wait window "DDD"],,,,.T.) .AddMenuBar("EEE",[oTHISFORM.myproc(prompt)],,,,,oTHISFORM.lbold) ENDWITH

Thisform._shortcutmenu1.ShowMenu   In the custom Myproc method, place the following code: PARAMETER cPrompt

DO CASE CASE cPrompt = "Check/UnCheck CCC" IF Thisform.lcheck Thisform.lcheck = .F.              WAIT WINDOW "PPP is now unchecked" NOWAIT ELSE Thisform.lcheck = .T.              WAIT WINDOW "PPP is now checked"  NOWAIT ENDIF CASE cPrompt = "EEE" IF Thisform.lbold Thisform.lbold = .F.           ELSE Thisform.lbold = .T.           ENDIF ENDCASE  Save and run the form.</ol>

Right-click the form and select "Check/UnCheck CCC" to either place or remove a check mark next to the "CCC" menu prompt. A WAIT WINDOW command appears each time you toggle the check mark. Select the "EEE" prompt to toggle the bold face on or off.

Additional query words: kbVFp600 kbFFC

Keywords: kbhowto kbcode KB193783

-

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

© Microsoft Corporation. All rights reserved.