Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a Menu inside a Form 1

Status
Not open for further replies.

Xaplytz

Programmer
Jun 26, 2000
79
US
Make a Menu inside a Form<br>I was trying to make a menu inside a Form&nbsp;&nbsp;by calling&nbsp;&nbsp;a *.prg where is define the menu. The menu works but when&nbsp;&nbsp;goes to other object disappears also to active a button or exit, I have to click twice.<br><br>If somebody have done this before I will appreciate any commentaries.<br><br>Thank.<br><br>
 
I placed the following in the init code of FORM1 to activate a menu at the top of the form:<br><br>DEFINE MENU TEST BAR IN WINDOW FORM1<br><br>DEFINE PAD ONE OF TEST PROMPT &quot;Test&quot; COLOR SCHEME 3 ;<br> KEY ALT+T, &quot;&quot;<br>DEFINE PAD TWO OF TEST PROMPT &quot;Help&quot; COLOR SCHEME 3 ;<br> KEY ALT+H, &quot;&quot;<br>ON PAD ONE OF TEST ACTIVATE POPUP test<br>ON PAD TWO OF TEST ACTIVATE POPUP help<br><br>DEFINE POPUP test MARGIN RELATIVE SHADOW COLOR SCHEME 4<br>DEFINE BAR 1 OF test PROMPT &quot;Test 1&quot;<br>DEFINE BAR 2 OF test PROMPT &quot;Test 2&quot;<br>ON SELECTION BAR 1 OF test WAIT &quot;TEST1&quot; WINDOW<br>ON SELECTION BAR 2 OF test WAIT &quot;TEST2&quot; WINDOW<br><br>DEFINE POPUP help MARGIN RELATIVE SHADOW COLOR SCHEME 4<br>DEFINE BAR 1 OF help PROMPT &quot;Help 1&quot;<br>DEFINE BAR 2 OF help PROMPT &quot;Help 2&quot;<br>ON SELECTION BAR 1 OF help WAIT &quot;HELP1&quot; WINDOW<br>ON SELECTION BAR 2 OF help WAIT &quot;HELP2&quot; WINDOW<br><br>ACTIVATE MENU TEST NOWAIT<br><br>**********<br><br>I think the key to your problem may be the NOWAIT clause of the ACTIVATE MENU command.&nbsp;&nbsp;I didn't try this from a .prg but I assume it would work also, although keeping the code with the form might be helpful as well.&nbsp;&nbsp;You would want to put some cleanup code for deactivating the menu etc.<br><br>By the way I created the test menu with the menu builder then compiled it and copied the code from the .mpr That is probably faster than hand coding it.<br><br>Maybe others could post their suggestions as well.<br><br>CDavis
 
Thank you It works, but always I have to click twice when I choose other object
 
I'm not sure what is causing that problem.&nbsp;&nbsp;Without seeing your code it would be difficult to diagnose.&nbsp;&nbsp;-- Maybe someone else will post some possible solutions.<br><br>CDavis
 
If you read the header of a menu created with the VFP machinery (as opposed to rolling your own) it tells you how to do this.

Create a menu in the project manager and print out the MPR file.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top