• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Differences between a UserControl and Form

What are the differences between a UserControl and a Form?

For my application, I'm creating an application that looks like a Single Document Interface (SDI).  I have one main Form and the each button on the toolbar brings a different page to the foreground.

At the moment, each page is a child form.  What are the pro/cons of using a usercontrol for each page instead.

I've tried it and I know that I can accomplish the same look / interaction on both.

I would also like to know how each is affected by double buffering and resources.
0
neelbak
Asked:
neelbak
1 Solution
 
Fenris_LokissonCommented:
Actually i don't think it will make much difference. In the last code I posted in your other question http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21396457.html 
I set a form as a child of another form. This means it now acts as a control (which a form basically is as it inherits from controlcontainer which in turn inherits from control which goes all the way down to object, pretty much the same as a usercontrol does). It just happens to have the same properties and events as a form.
If you want to access it you wil have to loop trough the main form.controls to find it. You won't find it in ownedforms or mdichildren.

So basically both will work the same way, using a similar amount of resources. Except that both have a different set of functions. A usercontrol has some useful functionality, such as docking, while a form as mdichild has several useful features such as menu merging.

It all boils down to what you want to do with it and which functionalities you need most and want to use without having to write a lot of code (You can of course always add the same behavior to either, writing your own code).
0
 
neelbakAuthor Commented:
Thanks for the advice.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now