【问题标题】:RichTextBox CtrlI富文本框 CtrlI
【发布时间】:2008-11-11 20:05:48
【问题描述】:

我在 .NET WinForms 中有一个 RichTextBox。我一直在用 KeyUp 连接热键。一切正常,除了 CtrlI。轮到我的处理程序时,选择已被替换为“\ t”。我关闭了 ShortcutsEnabled,但没有任何区别。有什么想法吗?

【问题讨论】:

    标签: c# winforms richtextbox


    【解决方案1】:

    这样做:

    using System;
    using System.Windows.Forms;
    
    public class MyRtb : RichTextBox {
      protected override bool ProcessCmdKey(ref Message m, Keys keyData) {
        if (keyData == (Keys.I | Keys.Control)) {
          // Do your stuff
          return true;
        }
        return base.ProcessCmdKey(ref m, keyData);
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多