Update Databinding on lost focus

后端 未结 1 2048
南旧
南旧 2020-12-19 10:46

I\'ve seen that WPF has a UpdateSourceTrigger property that will allow for data binding to take place after a control has lost focus, is there something similar for winforms

相关标签:
1条回答
  • 2020-12-19 11:10

    In the end I had to manually update the databinding withith the CheckedChanged event.

    For example, using the source for my example program.

    checkBox1.CheckedChanged += (s, e) => { 
      dc.BooleanVal = ((CheckBox)s).checked;
      customControl1.Text = "3"; 
      label1.Text = dc.BooleanVal.ToString(); };
    
    0 讨论(0)
提交回复
热议问题