Differences between a UserControl and Form

Posted on 2005-05-10
Last Modified: 2010-04-23
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.
Question by:neelbak
    LVL 2

    Accepted Solution

    Actually i don't think it will make much difference. In the last code I posted in your other question
    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).
    LVL 2

    Author Comment

    Thanks for the advice.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now