ToolstripMenuItem shortcut key broken in .NET 2.0

  • Thread starter Thread starter cody
  • Start date Start date
C

cody

When using .NET 1.1, we could use:

menuitem.Text = "Fullscreen\tF"; // see the tabulator inside

which displayed the key F as a shortcut in the menuitem which now
doesn't work anymore. We cannot assign F as a shortcut directly because
it is an invalid value for the ShortcutKeys enumeration.
Do we have to use ProcessCmdKey to check for that key which works well
but we cannot display it in the menuitem properly.
Is this a known bug? Any workarounds?
 
cody said:
When using .NET 1.1, we could use:

menuitem.Text = "Fullscreen\tF"; // see the tabulator inside

which displayed the key F as a shortcut in the menuitem which now
doesn't work anymore. We cannot assign F as a shortcut directly because
it is an invalid value for the ShortcutKeys enumeration.
Do we have to use ProcessCmdKey to check for that key which works well
but we cannot display it in the menuitem properly.
Is this a known bug? Any workarounds?

I found it! In .Net 2.0 there is a new property in the ToolstripMenuItem
class which is "ShortcutKeyDisplayString" which is exactly what I want!
Sorry for annoying you!
 
Back
Top