You could do a work around. It could be specific to a given UserControl, or
a more generic function that works from inside the UserControl. In the
(simpler) first case,
you could just loop through the controls of the UserControl from the hosting
form's Load event and use directcast to make form-wide references (or
whatever scope you need) of the contained controls. You would need nested
loops to get into a container control such as the TabControl.
At the more generic level, you could create a GetControls method that
operates from within the UserControl. Again, you would have to use nested
loops where you have containers. A hashtable would be a good return value
type, and you could create a naming scheme for the keys to help in
identifying the controls at the form level. Using the hashtable.containskey
you should be able to easily get a reference to the contained controls from
the form.
As an alternative, you could inherit directly from the container control,
then apply the same ideas above. At least your control would automatically
have the intellisense access you want at the top level. That would take one
layer out as you probe for the contained objects.
"Jim Hubbard" wrote:
If I create a usercontrol that is a tab with a webbrowser control on it, by
default the new control exposes no properties of the tab or webbrowser
control.
What is the easiest way to bubble the public properties, methods and
functions up to the usercontrol interface?