Assuming WinForms;
If the text field is bound to an object property, you must implement the INotifyPropertyChanged interface for the object and report the value of the string to be modified.
public class MyClass : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private string title; public string Title { get { return title; } set { if(value != title) { this.title = value; if (this.PropertyChanged != null) { this.PropertyChanged(this, new PropertyChangedEventArgs("Title")); } } }
With the above, if you bind to the Title property, the update will take place βautomaticallyβ to all forms / text fields that are attached to the object. I would recommend this above by sending specific events, as this is the usual way to notify updates are bound to object properties.
Thies
source share