Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在运行时为contextstrip项提供快捷键_C# - Fatal编程技术网

C# 在运行时为contextstrip项提供快捷键

C# 在运行时为contextstrip项提供快捷键,c#,C#,我正在运行时向上下文条添加一个项目列表。是否可以在运行时为这些项目添加快捷键…假设您使用的是MenuItems,您只需为它们指定: 您可能还希望将ShowShortcut属性设置为true,以便快捷方式显示在菜单项旁边 var menuItem = contextMenu.MenuItems[0]; menuItem.Shortcut = Shortcut.CtrlS;

我正在运行时向上下文条添加一个项目列表。是否可以在运行时为这些项目添加快捷键…

假设您使用的是
MenuItem
s,您只需为它们指定:

您可能还希望将
ShowShortcut
属性设置为true,以便快捷方式显示在菜单项旁边

var menuItem = contextMenu.MenuItems[0];
menuItem.Shortcut = Shortcut.CtrlS;