如何编程调用文本框的点击事件处理程序
I know how to programmatically invoke the event handler of a Button:
button1.PerformClick();
I would like to do the same for the Click
event handler of a TextBox
.问题是文本框没有
textBox1.PerformClick();
I know how to programmatically invoke the event handler of a Button:
button1.PerformClick();
I would like to do the same for the Click
event handler of a TextBox
. The problem is that TextBox does not have a
textBox1.PerformClick();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议方法提取(为什么我们应该混合UI - Windows消息和业务逻辑):
然后你可以调用
onMyTextBoxClick:
编辑: 如果您确实想要
EventArgs
参数,只需提供它们即可:用法:
I suggest method extraction (why should we mix UI - windows messages and Business Logic):
Then you can just call
onMyTextBoxClick
:Edit: If you really want
EventArgs
aruments, just provide them:Usage: