摘要:
///
/// 组合键转换成字符串类型
///
/// 键值
/// 字符串
private string CombineKeyCodeToString(Keys keyCode)
{
if (keyCode == Keys.None) return "无";
string strResult = string.Empty;
// 判断是否包含Ctrl键
if ((keyCode & Keys.Control) == Keys.Control)
{
strResult += "Ctrl + ";
// 去除Ctrl键
keyCode &= ~Keys.Control;
}
// 判断是否包含Alt键
if ((keyCode & Keys.Alt) == Keys.Alt)
{
strResult += "Alt + ";
// 去除Alt键
keyCode &= ~Keys.Alt;
}
阅读全文