Search code examples
c#eventstextboxtextchanged

Why Text_Changed event of TextBox does not fire when we change its text programmatically?


I have designed a softkeypad and changing textbox text programmatically such as

myKeypad.getControl.Text += "Char";

but textbox textchanged event does not fire. How can I solve this problem? Is it possible that we can create custom textChanged and KeyPressed Events which can fire by changing text or key press by softkeypad programmatically?


Solution

  • It should be triggered.

    From MSDN Control.TextChanged Event:

    This event is raised if the Text property is changed by either a programmatic modification or user interaction.

    Where are you adding the Event Handler?