How to save bindings when triggering a TextChanged event?

I use the Control.TextChanged event to determine when the user changed the form. I have a method that goes through each control and adds the same TextChanged to all the controls.

My problem is that in the form, I also have a data binding that binds the bindings to Binding.Format () and Binding.Parse (), and they are in TabControl. If the user changes the tabs (SelectedIndexChanged), he then fires Format / Parse and fires the TextChanged event, which makes him look like the form was resized!

How can I (1) save bindings or Binding.Format and .Parse from triggering a TextChanged event, or (2) implement a better way to detect controls in a form?

+3
source share
1 answer

Instead of checking the actual event, TextChangedcheck the backup properties and see when they change. You can use INotifyPropertyChangedto help with this.

0
source

All Articles