public class MyRichTextbox : RichTextBox
    {
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if ((keyData == (Keys.Control | Keys.Enter)))
            {
                MessageBox.Show("ctrl+enter");

                return true;
            }
            else if (keyData==Keys.F5)
            {
                MessageBox.Show("f5");
                return true;
            }
            else
            {
                return base.ProcessCmdKey(ref msg, keyData);
            }
        }
    }
posted on 2008-06-23 20:06  白沙河  阅读(305)  评论(0编辑  收藏  举报