Control visible does not work
I have a very strange problem. Any help will be appriciated.
I have a form with few controls. The controls are invisible, and when the user performs some operations the controls ahould become visible.
Code:
control.Visible = true;
I put a breakpoint in this line, but the control's Visible property stays "false" and the control does not become visible.
Any idea what can cause this phenomenon?
Re: Control visible does not work
Re: Control visible does not work
It is contained in a visible usercontrol. The form itself is contained in an MFC form (by setting the parent of the form to be the MFC form).
This looks like a bug in windows, because even if the control is visible, the .NET framework seems to think it is not visible:
Code:
control.Visible = true;
if (!control.Visible)
MessageBox.Show("Not visible");
And even if the control is visible the messagebox is shown.
Have no idea what this means.
Re: Control visible does not work
may be they are located inside another control, and the property of that control is set to invisible?
Re: Control visible does not work
This is not the case for me.
I kind of solved the problem by placing the Visible = false inside the Load event, instead of setting it in the designer.