[RESOLVED] [2005] Need to have a sub that expects a container
How would I declare a sub to only allow container object to be passed to it? Is this possible?
Re: [2005] Need to have a sub that expects a container
Code:
Private Sub MySub(ByVal pnl As Panel)
End Sub
Re: [2005] Need to have a sub that expects a container
Is it possible to make it so it accepts any type of container and not restrict it to just one specific, ie panel?
Re: [2005] Need to have a sub that expects a container
What do you mean by a container? You simply declare your parameter as the most specific type that's common to all the objects you want to be able to accept. That might be ContainerControl, ScrollableControl, Control or something else. Simply look up the MSDN documentation for each type you want to support and you'll see their inheritance hierarchy.
Re: [RESOLVED] [2005] Need to have a sub that expects a container
thanks, using ContainerControl... monday morning > me