
Menu Accelerator Key Underlines Missing in Context Menu
If you're running 2000 or XP, the menu accelerators are not underlined by
default unless you use the keyboard to open the menus on the normal menus. I
suspect the same is true for popup menus. I don't know of a way to force
the underlines to be visible short of changing a system setting with
SetKeyboardCues() before and after calling TrackPopupMenu()
Jay
Quote:
> Hello,
> I am creating a popup Context Menu based on a right click. The menu is
> coming up fine but the underline of the Accelerator Key in each menu item
is
> not being displayed in the menu. It is interesting that the menu responds
> to the Accelerator Key; there is just no underline under the letter in the
> menu item. Here is sample code:
> CMenu Menu;
> Menu.CreatePopupMenu();
> Menu.AppendMenu(MF_ENABLED | MF_STRING,1000,_T("&Menu Item 1"));
> Menu.AppendMenu(MF_SEPARATOR,1001,_T(""));
> Menu.AppendMenu(MF_ENABLED | MF_STRING,1002,_T("Cance&l"));
> CPoint ScreenPoint = m_CurrentPoint;
> this->ClientToScreen(&ScreenPoint);
> Menu.TrackPopupMenu(TPM_LEFTALIGN,ScreenPoint.x,ScreenPoint.y,this);
> In this example the menu appears with "Menu Item 1" and "Cancel" as the
menu
> items and pushing "M" or "l" activates the menu item but the underline is
> missing under the "M" and "l".
> In other applications such as Word the context menus do show the
underline.
> Can anyone explain what's going wrong here?
> Thanks,
> Jim...