for each control there are a lot of events, two are very similar such as Text Update and Text Changed, whis is the difference?
The TextChanged event is raised when the content of the text box changes between posts to the server. The event is only raised if the text is changed by the user; the event is not raised if the text is changed programmatically.
The event handler is called whenever the contents of the TextBox control are changed, either by a user or programmatically. This event fires when the TextBox control is created and initially populated with text.
Here's my take on things, with sources from MSDN. I've used TextBox and ComboBox for my examples, however I'm fairly sure the logic generalizes.
TextUpdate:
Occurs when the control has formatted the text, but before the text is displayed. Use the TextUpdate event to validate the text before it is actually shown.
An example would be if a ComboBox is being populated from some datasource, and the data changes. This could trigger the TextUpdate event to allow for validation (or anything else).
http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.textupdate(v=vs.110).aspx
TextChanged:
Occurs when content changes in the text box. User input or setting the Text property to a new value raises the TextChanged event.
I think that quotation covers the example usage.
http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.textchanged(v=vs.95).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With