开发者

Data binding fails when changing numbers on numericUpDown

开发者 https://www.devze.com 2022-12-17 23:33 出处:网络
I have a databinding like this: numericUpDown1.DataBindings.Add(\"Value\", myBox1, \"Width\"); Whenever myBox1.Width changes it will update numericUpDown1.Value.

I have a databinding like this:

    numericUpDown1.DataBindings.Add("Value", myBox1, "Width");

Whenever myBox1.Width changes it will update numericUpDown1.Value.

The problem is when entering new numbers on the control, myBox1.Width will not be updated immediately, but only after the cursor leaves the text area of the control. Is there any 开发者_运维技巧workaround to this bug? Thanks!


Change the code like this:

numericUpDown1.DataBindings.Add("Value", myBox1, "Width", false, DataSourceUpdateMode.OnPropertyChanged);
0

精彩评论

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