【问题标题】:How to insert @ sign with key combination (AltGr+V)?如何使用组合键(AltGr+V)插入@符号?
【发布时间】:2016-10-03 05:16:50
【问题描述】:

我正在使用 Winforms-Grid 应用程序中的一组查询。其中一个需要使用组合键 (AltGr+V) 插入“@”符号。请任何人建议我,是否有可能或我该如何实现?

谢谢。

【问题讨论】:

    标签: c# winforms keyboard-shortcuts


    【解决方案1】:

    覆盖 ProcessCmdKey 以在用户按下该组合键时进行捕获。

    protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    {
      if (keyData == Keys.V && Control.ModifierKeys == Keys.RMenu)
      {
        //insert @ whereever you want it
        return true;
      }
      return base.ProcessCmdKey(ref msg, keyData);
    }
    

    【讨论】:

      猜你喜欢
      • 2016-11-02
      • 1970-01-01
      • 2015-03-25
      • 1970-01-01
      • 1970-01-01
      • 2020-09-29
      • 2019-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多