给控件添加事件 (webform)
webform当中的textbox控件只有change事件,能否从增加一个keypress事件?
从winform里继承过来?还是怎样?
我现在这样写的,不行:
...
using System.Windows.Forms;
...
...InitializeComponent
this.txtState.KeyPress += new System.EventHandler(this.txtState_KeyPress);
...
...
private void txtState_KeyPress(object sender, System.EventArgs e)
...
望高手赐教,不胜感激!