一个Sub中文本框的所有事件 [英] All events of a textbox in one Sub

查看:66
本文介绍了一个Sub中文本框的所有事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我只是想知道它是否有可能有一个处理文本框Textbox.Leave,Textbox.Keypress和Textbox.KeyDown事件的子



谢谢

解决方案

是的可能。试试这种方式,但我不确定你会得到所需的信息。



 这个 .textBox1.KeyDown + =  new  System.Windows.Forms.KeyEventHandler( this  .textBox1_Leave ); 
this .textBox1.KeyPress + = new System.Windows.Forms.KeyPressEventHandler( .textBox1_Leave);
this .textBox1.Leave + = new System.EventHandler( .textBox1_Leave);


Hi
Am just wondering if its possible to have a sub that handles the event of a textbox Textbox.Leave, Textbox.Keypress, and Textbox.KeyDown

Thank you

解决方案

Yes its possible. Try this way but iam not sure of you will get the required information.

this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_Leave);
          this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_Leave);
          this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);


这篇关于一个Sub中文本框的所有事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆