Menu Accelerator Key Underlines Missing in Context Menu 
Author Message
 Menu Accelerator Key Underlines Missing in Context Menu

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...



Mon, 10 May 2004 02:09:09 GMT  
 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...




Mon, 10 May 2004 03:53:16 GMT  
 Menu Accelerator Key Underlines Missing in Context Menu
You might want uncheck the box
            'Hide keyboard navigation indicators until I use the Alt key'

    in your Control Panel->Display-->Effects Tab.

Cheers
Check Abdoul
--------------------


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...




Mon, 10 May 2004 04:06:42 GMT  
 Menu Accelerator Key Underlines Missing in Context Menu

Quote:
>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.

Jim,

Which operating system are you using? If it's Windows 2000, it's
probably the "Hide underlined letters until I press the Alt key"
setting in the display applet. Do other application (such as Notepad)
hide their accelerators?

Do the accelerators show if you invoke the context menu from the
keyboard (Shift+F10 if you don't have a specific key) rather than with
the mouse?

Quote:
>In other applications such as Word the context menus do show the underline.

Word isn't using a normal menu!

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Mon, 10 May 2004 04:10:08 GMT  
 Menu Accelerator Key Underlines Missing in Context Menu
Hi Jay,

Thanks.  You were right.  The problem was under 2000 and the Display applet
has a setting that allows display of the underlines.

Jim...


Quote:
> 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()



Wed, 12 May 2004 02:36:58 GMT  
 Menu Accelerator Key Underlines Missing in Context Menu
Thanks!  That was it.

Jim...


Quote:
> You might want uncheck the box
>             'Hide keyboard navigation indicators until I use the Alt key'

>     in your Control Panel->Display-->Effects Tab.

> Cheers



Wed, 12 May 2004 02:37:54 GMT  
 Menu Accelerator Key Underlines Missing in Context Menu
Hi Dave,

Thanks.  You were right.  The problem was under 2000 and the Display applet
fixes the problem!

Jim...



Wed, 12 May 2004 02:39:14 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Listctrl context menu + shell context menu

2. [Q} Adding own context menu to desktop context menu [again]

3. Popup menu accelerator keys

4. How do you trigger a Command without using a menu, button or accelerator key

5. Popup menu accelerator keys

6. Insert New ATL Object is Missing From The Context Menu

7. help working with context menus and adding menu items dynamically

8. Adding a menu or context menu item in Internet Explorer

9. Adding a menu or context menu item in Internet Explorer with URL

10. Context Menu and System Menu

11. How to get original context menu of IE from IDocHostUIHandler::ShowContextMenu function

12. Using ON_UPDATE_COMMAND_UI in Context Menu(pop-up menu)

 

 
Powered by phpBB® Forum Software