A Form(?) appears briefly outside of Form1 when adding a control to it

Posted by ispiro on Stack Overflow See other posts from Stack Overflow or by ispiro
Published on 2012-10-31T16:59:20Z Indexed on 2012/10/31 17:00 UTC
Read the original article Hit count: 129

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET