Hi,
I have a form with 2 tab controls. Form opens on tab 1. I have a few controls I need to validate on tab2.
If the controls I want to validate have been set to not Visible then I want to ignore validation. (i.e. The controls have been hidden from the user) Problem is all the controls on tab 2 return Visible=False, because the Tab is not selected.
Becuase Visible on an individual control returns False if any of the parent's Visible property is False, I can't find out whether a control has been set to Visible=False in code or whether Visible=False becuase the parent tab control is not visible.
Any ideas how I can find out whether a control has been set to Visible=False in code? The private "state" variable in the control class seems to hold this info but I'd prefer not to have to use reflection... this will be slow and feels a bit hacky!
My only other idea is that I'm going to have to add my own property to the control class to hide them (they are controls that I have written)
But this means lots of work on all my forms (I have many forms that have various bits of code to hide individual controls or groups of controls)
Hope that makes sense.
Thanks, Mike G