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

  • SEARCH
  • Home
  • 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 8769451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:21:07+00:00 2026-06-13T17:21:07+00:00

I have a program which creates new Control s (actually – Form ‘s with

  • 0

I have a program which creates new Controls (actually – Form‘s with TopLevel = false) and puts them on a Panel which is on Form1.

For some reason, this is usually followed by what seems like a Form appearing very briefly outside of Form1. It’s hard to tell exactly what’s happening because it’s so brief. Perhaps it’s Form1 moving there (and changing its size) and then returning. Or perhaps it’s the Form that’s being put on Form1 that appears there (though how could that happen at all? It’s out of Form1!).

I couldn’t find anything in the code that might cause it, and the whole code is way too long to post here. (The relevant code is simply: MyPanel.Controls.Add(newForm);.)

Is there any known bug that might cause this?

  • 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-06-13T17:21:09+00:00Added an answer on June 13, 2026 at 5:21 pm

    I can sort of guess what the code looks like. The problem with adding a Form to the Controls collection with TopLevel = false is that you have to explicitly make it visible. This is an odd quirk (aka bug), normally a control automatically becomes visible when you add it to a Controls collection.

    So it probably looks like this:

    var newform = new Form1();
    newform.Visible = true;    // or newform.Show()
    newform.TopLevel = false;
    MyPanel.Controls.Add(newForm);
    

    And yes, that can make it visible for a very brief moment, still as a top-level window, if you do something else that causes messages to be dispatched. Fix it by swapping the Visible and TopLevel property assignments.

    If this doesn’t help then post a code snippet.

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

Sidebar

Related Questions

I have a form that has a button which creates a new object and
I have a program which creates JButtons which are then added to a JPanel
I am new to java programming. I have a program which I wrote to
I have a program which creates DialogBox window when user clicks the menu item
I have a library which creates objects (instances of class A) and pass them
I have an AppleScript program which creates XML tags and elements within an Adobe
Okay, I have a function which reads a xml file and creates controls using
I have a MouseEnter event which currently handles some custom controls on my form.
I have created a program which allows me to upload images to my server.
I have been trying to create a simple program with Python which uses OpenCV

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.