Nope, not the direction I was going.
Let's see... it will be easier for me to start with the example I'm working
on at the moment. Picture a form where a user can select from a list of
items. When this list's selected item changes, the containing form handles
this as an event and notifies many other controls - all of which are on
various tab pages - that the selected item has changed. These controls, on
being notified, need to reload data based on this new parameter. As you
might guess, in the interest of making forms of such design more efficient,
I cause these data-loading controls to check first to see if they're
available to the user in the first place. If, for instance, a control finds
an unselected tab page in its chain of parents, it can set a local
'LoadDeferred' bit, and defer loading until OnVisibleChanged.
Simply checking for unselected tab pages in a control's parent chain does do
the trick for a lot of cases. But I want to solve for the general case; if
the user isn't going to see the control, I want it to hold off loading data
until it becomes visible. Using the Visible property is what I would want to
use, but this doesn't work if I want to make a selection (load a saved
state) before the form is even shown. I can't use an 'is this control
currently visible' property, I need an independent 'was this control told to
be visible in this parent' property.
Does that make any sense?
Anyway, there are hacks around this problem, and I don't exactly _have_ to
load a form's saved state before it becomes visible. But that looks messier,
causes a double-loading of data, and I *know* that hierarchal Visible
information is available somewhere, because the WinForms uses it to give you
an end result. I just need to know how to get at it. Perhaps there's an API
call?
Bob
> Nothing will show Visible until the form itself has shown itself. You can
> test this by setting up two forms. Form1 has just a button called button1.
[quoted text clipped - 24 lines]
> event what you want on and off on the form based on the users credentials.
> This is of course assuming that is the direction you are going with this.