Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 193783 - Last Review: July 13, 2004 - Revision: 1.1
How To Use the _ShortCutMenu Foundation Class
This article was previously published under Q193783
This article describes how to create a shortcut menu using the
_ShortCutMenu Foundation Class in the _menu.vcx class library.
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.
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.
APPLIES TO
- Microsoft Visual FoxPro 6.0 Professional Edition
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate