Data Binding Fails When Changing a Number to numericUpDown

I have a data binding as follows:

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

Whenever myBox1.Width changes, it updates numericUpDown1.Value.

The problem is when entering new numbers into the control, myBox1.Width will not be updated immediately, but only after the cursor leaves the text area of ​​the control. Is there a workaround to this error? Thank!

+3
source share
1 answer

Change the code as follows:

numericUpDown1.DataBindings.Add("Value", myBox1, "Width", false, DataSourceUpdateMode.OnPropertyChanged);
+8
source

Source: https://habr.com/ru/post/1729113/


All Articles