开发者

Handle that Shift+F10 w(h)as pressed?

开发者 https://www.devze.com 2022-12-25 16:26 出处:网络
I want to use the exclusive key to open context menu that are available in most of the new laptops and keyboards. This key is usually available between right ALT and CTRL key.

I want to use the exclusive key to open context menu that are available in most of the new laptops and keyboards. This key is usually available between right ALT and CTRL key.

I am not sure that it is always equivalent to "Shift + F10" ( or is it always equivalent to "Shift+F10" ?).

My programs runs on Windows XP and earlier vers开发者_如何学Goions.

Context menu should appear at mouse cursor position (if it's possible).


It generates the Keys.Apps keystroke. Paste this code into your form:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
  if (keyData == Keys.Apps) {
    MessageBox.Show("Context menu here please");
    return true;
  }
  return base.ProcessCmdKey(ref msg, keyData);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号