有没有数据绑定的无形的防治工作?绑定、数据、工作

2023-09-02 10:53:29 作者:喂,你的裤衩好耀眼

这是一个.NET问题的WinForms,而不是asp.net。

This is a .net problem with winforms, not asp.net.

我有一个窗口的形式有几个选项卡。我将所有控制数据绑定,当窗体加载。但我注意到,控件的第二个选项卡上的数据绑定不工作。这些绑定只有当​​窗体加载工作,当我选择了第二个选项卡。这使怀疑我:数据绑定只有工作的时候绑定控件可见

I have a windows form with several tabs. I set data bindings of all controls when the form is loaded. But I have noticed that the data bindings of controls on the second tab do not work. Those bindings work only when the form is loaded and when I select the second tab. This brings the suspicion to me: data bindings work only when bound controls become visible.

任何人都可以告诉我这是否是真还是假?不难对此进行测试,但我想知道一些确认。

Anyone can tell me whether this is true or not? It is not hard to test this but I would like to know some confirmation.

感谢

推荐答案

您是正确的。数据绑定控件不更新,直到控制变得可见。

You are correct. A data-bound control are not updated until the control is made visible.

唯一的参考,我可以找到这个目前是这个MSDN线程。

The only reference I can find for this at the moment is this MSDN thread.