Microsoft KB Archive/156875

= PRB: Empty Bars Appear in Shortcut Menu =

Article ID: 156875

Article Last Modified on 10/15/2003

-

APPLIES TO


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

-



This article was previously published under Q156875



SYMPTOMS
Empty bars appear within a shortcut menu after creating the menu with the DEFINE POPUP command.



CAUSE
The DEFINE POPUP command did not include the RELATIVE clause.



RESOLUTION
Add the RELATIVE clause to the DEFINE POPUP command. This clause prevents blank spaces from appearing within the shortcut menu. Change the DEFINE POPOP command to read: DEFINE POPUP Test SHORTCUT RELATIVE



STATUS
This behavior is by design.



MORE INFORMATION
If the DEFINE POPUP command lacks the RELATIVE clause, the order of a particular menu bar depends on its bar number. In the example below, the shortcut menu contains three system menu bars and a bar defined as "BAR 4." Bars 1, 2, and 3 are not defined; therefore, three spaces appear between the "Paste" and "Date" bar items.

The Menu Builder automatically places the RELATIVE clause on the DEFINE POPUP command it uses to create shortcut menus.

Steps to Reproduce Behavior
  Create a program that contains the following code: DEFINE POPUP Test SHORTCUT DEFINE BAR _MED_CUT OF Test PROMPT "Cut" DEFINE BAR _MED_COPY OF Test PROMPT "Copy" DEFINE BAR _MED_PASTE OF Test PROMPT "Paste" DEFINE BAR 4 OF Test PROMPT "Date" ON SELECTION BAR 4 OF Test KEYBOARD DTOC(DATE) ACTIVATE POPUP Test AT MROW,MCOL  Run the program. The shortcut menu contains several blanks lines within it. Click the mouse and the shortcut menu disappears.

