[英]C# - How to write a Leave Event for a textbox that has been created dynamically
I have a dynamically created text box. 我有一个动态创建的文本框。 I want to register a function on the Leave event. 我想在Leave事件上注册一个函数。 How do I do that? 我怎么做?
textbox = new TextBox();
try: 尝试:
textbox.Leave += new EventHandler(textBoxLeave);
actual handler: 实际的处理程序:
private void textBoxLeave(object sender, EventArgs e)
{
// put your code here
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.