MDI子窗体内的文本框Ctrl + C / Ctrl + V不起作用

时间:2014-03-25 14:28:35

标签: c# winforms textbox

正如我在标题中所解释的,我喜欢在我的子表单中使用快捷键,但它不起作用。

 private void textBox_KeyPress(object sender, KeyPressEventArgs e)
   {  
       if (e.KeyChar == '\t' || e.KeyChar == '\r')
       {  }
       else
       {
           char ch = e.KeyChar;
           if (!Char.IsDigit(ch) && ch != 8)
           {
               e.Handled = true;
               MessageBox.Show("Please enter number!");
           }
       }
    }

0 个答案:

没有答案