Hi Mystique,
In addition to what I said in my previous post I want to give you and
example that numpad shortcuts are not supported only because they are not
listed in the Shortcut enum.
Assuming that you want to set the shortcut for menuItem2 to Ctrl+NumPad0
put this code in the form cosntructor after InitializeComponent call.
Type t = typeof(MenuItem);
FieldInfo fi = t.GetField("data", BindingFlags.Instance |
BindingFlags.NonPublic);
object miData = fi.GetValue(menuItem2);
t = miData.GetType();
fi = t.GetField("shortcut", BindingFlags.Instance | BindingFlags.NonPublic);
fi.SetValue(miData, (Shortcut)(Keys.Control | Keys.NumPad0));
Now menuItem2 responds to Ctrl+NumPad0
NOTE:
This is only for demonstration purposes.
You don't have to use a code such this in your application. Eventhough that
code works with .NET 1.0 and .NET 1.1 frameworks (and it may work with the
future versions) that is not a workaround that is framework hacking. It uses
internal ManuItem field (data) and even more it uses one internal type
(MenuItemData). Thus, my suggestion is don't use it in a real application it
is not reliable. Those fields and the type may be changed in future.