Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterialContextMenuStrip does not handle adding dynamic keyboard shortcut keys #90

Open
rrirower opened this issue Jan 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@rrirower
Copy link

rrirower commented Jan 14, 2023

Bug explanation

I create dynamic menu items for a MaterialContextMenuStrip with the following code:

contextMenu = new MaterialContextMenuStrip();
contextMenu.Opening += contextMenu_Opening;
int index = 0;

foreach (string option in ContextMenuOptions)
{
    ToolStripMenuItem tsi = (ToolStripMenuItem)contextMenu.Items.Add(option);
    img = new Bitmap(ContextMenuBitmaps[index++]);
    tsi.Image = img;
    tsi.ShortcutKeys = Keys.Control | Keys.C;      // Testing             
}

The shortcut key is added but is displayed at the beginning of the menu item thus overlaying the menu text. Please see the below image.

Capture

Version

3.7.9

@rrirower rrirower added the bug Something isn't working label Jan 14, 2023
@rrirower rrirower changed the title MaterialContextMenuStrip deos not handle adding dynamic keyboard shortcut keys MaterialContextMenuStrip does not handle adding dynamic keyboard shortcut keys Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant