|
-
Sep 29th, 2008, 07:00 AM
#1
Thread Starter
Frenzied Member
[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?
-
Sep 29th, 2008, 07:11 AM
#2
Re: [2005] Need to have a sub that expects a container
Code:
Private Sub MySub(ByVal pnl As Panel)
End Sub
Please mark you thread resolved using the Thread Tools as shown
-
Sep 29th, 2008, 07:16 AM
#3
Thread Starter
Frenzied Member
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?
-
Sep 29th, 2008, 07:19 AM
#4
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.
-
Sep 29th, 2008, 07:21 AM
#5
Thread Starter
Frenzied Member
Re: [RESOLVED] [2005] Need to have a sub that expects a container
thanks, using ContainerControl... monday morning > me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|