Couple event to dynamic textbox

  • Thread starter Thread starter Mobileboy36
  • Start date Start date
M

Mobileboy36

Hi all,

Is it possible to couple an event to x dynamically created textboxes??
Creating the controls dynamically is not that difficult. But how do I couple
an event to each created control?

Any help would be greatly apprciated.

Best regards
 
Hi,

You must add an event handler for the event you want, see the
following exampe for TextChanged event on a TextBox:

CustomTextBox1.TextChanged+=new
EventHandler(CustomTextBox1_OnTextChanged);

public void CustomTextBox1_OnTextChanged(object sender, EventArgs e)
{
// your code here
}

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/
 
Back
Top