Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6714259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:28:28+00:00 2026-05-26T08:28:28+00:00

I know it’s possible to use a Form as a child control in another

  • 0

I know it’s possible to use a Form as a child control in another Form.

ChildForm child = new ChildForm();
child.TopLevel = false;
child.FormBorderStyle = FormBorderStyle.None;
child.Show();
containerControl.Controls.Add(child);

I realise this is not what a Form was designed for. I was wondering what the implications here are, as opposed to using a UserControl? Are there any real downsides? Any large, unnecessary overheads? Any unexpected behaviours?

On the other hand, are there any advantages of using a form? Is there anything you can’t do with a UserControl that you can do with a form, which may be useful if used as a child control?

I understand that both Form and UserControl inherit ContainerControl, but how different do their non-inherited members make them?

My scenario

The reason I’m asking is because I have an existing Form control, that I’d like to be displayed on its own sometimes (for development and as a little extra feature), but it doesn’t need to be. However, I do need the Closing event of the form (which is not inherited from ContainerControl) and I need to be able to cancel closing the form if a file has been edited and not saved.

I’ve also noticed in my findings that a Form seems to have some transparency options that a UserControl doesn’t seem to have, but I’m not sure if these will work when the form is used as a child control.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:28:29+00:00Added an answer on May 26, 2026 at 8:28 am

    if you check the Inheritance Hierarchy in MSDN you find out that both UserControl and Form inherit from ContainerControl so in fact up to their base class nearly everything should be the same.

    said so, in general, I think you should avoid using a Form object hosted as a control unless you are dealing with legacy unchangeable code or unless you absolutely want this design so to be able, in certain other cases, to show the form all alone as top level non hosted anywhere.

    If you simply need a container to put your other UI controls you can use a UserControl.

    in fact everything down to the Win32 level translates to handles and message pumps / WindowProc etc, even a simple TextBox will have an handle and will receive and consume messages taking care of its client and non client area and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Know if it's possible to access the iPhone compass in Safari using JavaScript? I
Anyone know if it's possible to databind the ScaleX and ScaleY of a render
I know how to use the search feature on JQGrid where you send the
I know there are similar questions already on SO but none of them seem
Know of any tutorials or resources to configure Openfire Server to use it's built
Anyone know if it's possible to access the name of a jump link in
Anyone know how to quickly prepend (add two new lines of text) to the
I know that I can use ProxyPass to serve up my yardoc server instance
I know its probably possible, but is it practical and doable to try and
I know its probably possible, but is it practical and doable to try and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.