开发者

DataBinding feedback in .NET2

开发者 https://www.devze.com 2022-12-17 01:10 出处:网络
I have a object myObject.Name in a Form1 with a textBox1 In the Form1_Load I do: this.TextBox1.DataBindings.Add(\"T开发者_Python百科ext\", myObject, \"Name\");

I have a object myObject.Name in a Form1 with a textBox1 In the Form1_Load I do:

this.TextBox1.DataBindings.Add("T开发者_Python百科ext", myObject, "Name");

When validating the textBox I have myObject.Name changed. This is OK.

Now I modify internally in myObject _name = "changed value", but myTextBox text will not change. so... how to do it on both directions, from and to the textBox1?


Your object needs to implement INotifyPropertyChanged so that the data binding knows that your object changed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号