2009年5月26日
摘要: 在一个控件中使Tab键作为一般的输入键来触发KeyDown,KeyUp事件,需要自定义一个新控件 ,然后重写IsInputKey 方法 using System;using System.Windows.Forms;public class MyTextBox :System.Windows.Forms.TextBox{ // Override IsInputKey method to ident... 阅读全文
posted @ 2009-05-26 10:27 周雪峰 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 今天在论坛了看到了一个问题,所以仔细研究了一下,这个问题是关于Tab键和KeyDown,KeyUp事件!比如有一个TextBox控件,在有焦点的情况下按下Tab,是不会触发KeyDown事件的,而是直接移走输入焦点!也就是说这样是不能捕获Tab键的:private void textBox1_KeyDown(object sender, KeyEventArgs e) { e.Handled = ... 阅读全文
posted @ 2009-05-26 10:22 周雪峰 阅读(1802) 评论(1) 推荐(0) 编辑