In WinForms with C# 4.0 / C# 2.0, I cannot bind to a control if the control\'s visible field is false:
this.checkBox_WorkDone.DataBindings.Add(\"Visible\", W
My workaround:
private void Form_Load(object sender, EventArgs e)
{
button.Visible = true;
button.DataBindings["Visible"].ReadValue();
}
button.Visible = true;
is needed to force creating control (in other word, associate Button class instance with actual Win32 window handle).
Because data binding won't work until control is created. So create control at first.
And then reload actual Visible
value from data source by calling Binding.ReadValue()
.