ToolStripManager.IsValidShortcut(Keys) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检索一个值,该值指示所定义的快捷键是否有效。
public:
static bool IsValidShortcut(System::Windows::Forms::Keys shortcut);
C#
public static bool IsValidShortcut (System.Windows.Forms.Keys shortcut);
static member IsValidShortcut : System.Windows.Forms.Keys -> bool
Public Shared Function IsValidShortcut (shortcut As Keys) As Boolean
- shortcut
- Keys
要测试有效性的快捷键。
如果快捷键有效,为 true
;否则为 false
。
有效的快捷键是仅 F1 到 F12 的函数键;具有 CTRL、ALT 或 SHIFT 修饰符的函数键;或使用 Ctrl、Alt 或 SHIFT 修饰符的其他键。 如果单独使用,则除函数键以外的 Ctrl、Alt 或 SHIFT 键和键无效。
产品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |