Flint
Flint

Reputation: 11

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. How do I do that?

textbox = new TextBox();

Upvotes: 0

Views: 2170

Answers (1)

volody
volody

Reputation: 7189

try:

 textbox.Leave += new EventHandler(textBoxLeave);

actual handler:

    private void textBoxLeave(object sender, EventArgs e)
    {
        // put your code here
    }  

Upvotes: 1

Related Questions