-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Property 'Shorcutkeys' caused context menu to not show up #328
Comments
Argghghghg save me from weird undocumented Microsoft features! The issue is the Basically, when you set a shortcut key via the It turns out you cannot set the shortcut to something like This is terrible code here I've got to say; setting a property value should not call logic like this because it is totally unclear to the caller that there is actually a lot more going on (one would assume setting a property just sets a value, not go through a complex logic chain). The fact that this isn't even documented is worse! Anyway, I've noted this in the SharpShell docs here: https://github.com/dwmkerr/sharpshell/blob/master/docs/context-menu.md#shortcut-keys So hopefully others won't have this issue in the future! Thanks for all of the details you added when raising the issue, it made it much easier for me to debug what was going on! |
Got it. Thanks Dave! For example:
In the context menu it will be shown as:
And |
Great, glad it's working @galvn, I'll link the docs to this issue in case anyone else has the same challenge in the future. |
Version of SharpShell used: 2.7.2
Related type(s) of SharpShell-Server: : ShellContextMenu
Greetings.
Followed the Count Line project tutorial with a few tweaking and successfully built a dll as .net framework 4.0 class library using VS2019 on a win7 x64 PC.
Loaded it into ServerManager 2.7.2 and have all the info shown in the right panel. Then when I put it to the test in the test shell, the context menu failed to show up.
Eventually I found out that it is the 'Shortcutkeys' property of ToolStripMenuItem causing the issue.
Does any one have any ideas how this happened?
Here is the Sharpshell log roughly translated from Traditional Chinese:
My CreateMenu() method code snippet as follows:
Yes I also find out that ShortcutKeyDisplayString and ShowShortcutKeys cause the same problem as well but the reason seems different. The log shows that after querying Context Menu for items it just stoped right there.
The text was updated successfully, but these errors were encountered: