Search code examples
c#winformsmnemonics

Mnemonic not showing on a System.Windows.Forms.ContextMenu


I'm having some problems with Mnemonics and ContextMenus - although the Mnemonic property of the Menutem is set correctly the little underline wont show under the relevant key. Here is my code:

private void Form1_MouseDown(object sender, MouseEventArgs e)
{
    System.Windows.Forms.ContextMenu menu = new ContextMenu();
    menu.MenuItems.Add("Hello &World");
    menu.Show(this, e.Location);
}

What am I doing wrong?


Solution

  • There is a windows setting to "Hide underlined letters for keyboard navigation until I press the ALT key." It is under Display Properties --> Appearance --> Effects on XP ... Could that be what you're seeing?