M
Michael Kremser
Hi NG!
If you put a control on a tab page and you set its "Visible" property to
"True" and you select another tab page, the "Visible" property returns
"False", because the control is currently not visible to the user. But
other controls whose "Visible" property you set to "False" also return
"False", so "False" is not "False"... :-/
If one derives from a control, it´s possible to override SetVisibleCore
and store the bool argument to know whether the control is intended to
be visible to the user. But I don´t want to have an own control just for
that purpose. Also it would be possible to handle the "VisibleChanged"
event which is only fired if the "Visible" property *really* changes,
but I have a form with 24 text controls and I don´t want to store that
in an extra array or so.
So, is there a trick to find out whether a control is *intended* to be
visible and not if it is actually visible to the user?
To demonstrate this, I made a little project:
http://www.mkcs.at/dev/VisibleProperty.rar
Best regards,
Michael
If you put a control on a tab page and you set its "Visible" property to
"True" and you select another tab page, the "Visible" property returns
"False", because the control is currently not visible to the user. But
other controls whose "Visible" property you set to "False" also return
"False", so "False" is not "False"... :-/
If one derives from a control, it´s possible to override SetVisibleCore
and store the bool argument to know whether the control is intended to
be visible to the user. But I don´t want to have an own control just for
that purpose. Also it would be possible to handle the "VisibleChanged"
event which is only fired if the "Visible" property *really* changes,
but I have a form with 24 text controls and I don´t want to store that
in an extra array or so.
So, is there a trick to find out whether a control is *intended* to be
visible and not if it is actually visible to the user?
To demonstrate this, I made a little project:
http://www.mkcs.at/dev/VisibleProperty.rar
Best regards,
Michael