I have a TabControl in a Winforms app and on one of the tab pages, I have a label I use to inform the user of data deficiencies on the page. When the deficiencies are corrected, I hide the label, and make visible instead another label that indicates the data is valid.
The problem is, when the user switches to another tab, then comes back, both labels are visible. The problem seems to be that I need to rebuild various elements when the user selects the tab, and at the point I do this changing the visibility on the controls has no effect, which I am guessing is because the tabpage is not yet visible itself. I have tried to do it in the TabControl's Selected event, and in the tabpage's Enter event, but neither one has worked.
I have looked for an appropriate event - one occurring after the tabpage becomes visible, but before it is displayed to the user (or even immediately after it is displayed), but have not found one.
Is there an event that would be appropriate for setting visibility of controls on the tabpage? Or is there some other method of setting visibility before the tabpage is displayed?