PC Review


Reply
Thread Tools Rate Thread

Controlcontainer is .Net

 
 
=?Utf-8?B?SmVycnk=?=
Guest
Posts: n/a
 
      3rd Aug 2005
I’m currently familiarizing myself with VB.net and right now I’m looking at
the usercontrol. In VB6 it was possible for a usercontrol to act as a control
container. However, I can’t find a property in .Net that would make it work
similarly. When I look in the MSDN database, all I can find are documents
relating to VB6.
Please tell me a control container is still possible in .Net

 
Reply With Quote
 
 
 
 
Phill. W
Guest
Posts: n/a
 
      3rd Aug 2005
"Jerry" <(E-Mail Removed)> wrote in message
news:096AE6F1-9C18-4EC6-B7AC-(E-Mail Removed)...
> In VB6 it was possible for a usercontrol to act as a control container.
> However, I can't find a property in .Net that would make it work
> similarly. When I look in the MSDN database, all I can find are documents
> relating to VB6.
> Please tell me a control container is still possible in .Net


So you want to write a UserControl and then have other Controls
placed "onto" or "into" the finished article?

Look at the Modifiers on the UserControl and the other Controls
within it. By default, these are Friend, so you can only change them
within your UserControl's assembly. Change them to something more
useful, like Protected (for Developers to use) or Public (for end users).

HTH,
Phill W.


 
Reply With Quote
 
=?Utf-8?B?SmVycnk=?=
Guest
Posts: n/a
 
      3rd Aug 2005
Hi Phil,

What I was looking for is basically a combination of a .Net usercontrol and
a .Net panel control. Using the modifiers would give you access to controls
that are placed on the usercontrol itself and not enable you to add controls
to the usercontrol after the usercontrol has been placed on a form, right?

My question has become a bit irrelevant, though. I was a bit stuck in VB6
thinking and forgot about a bonus that .Net has. With inheritance I can
basically do that what I wanted to use the contained controls for. It will
mean more usercontrols in my project, but the forms will be cleaner.

Thanks,

Jerry
 
Reply With Quote
 
Phill. W
Guest
Posts: n/a
 
      4th Aug 2005
"Jerry" <(E-Mail Removed)> wrote in message
news:30E3354D-E807-458F-A449-(E-Mail Removed)...
> What I was looking for is basically a combination of a .Net
> usercontrol and a .Net panel control.


You could just create your own Control /directly/ derived from Panel,
if you wanted to.

> Using the modifiers would give you access to controls that are placed
> on the usercontrol itself and not enable you to add controls to the
> usercontrol after the usercontrol has been placed on a form, right?


Depends how you set them. IIRC, you can create a UserControl with
a Panel on it (that fills all of the available area), set all the modifies
to
Public and you should be able to drop new Controls onto it, even at
RunTime. I think.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Usercontrol ControlContainer Meelis Microsoft VB .NET 2 19th Mar 2006 08:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:56 AM.