I'm creating forms dynamically and their contained controls
programmatically,
rather than using the Form editor - using Controls.Add(Control).
Some forms created in this way cause the form underneath it to flash
(presumably refresh) when another form is closed. It happens
regardless of the screen position of the upper form. With some forms
it does not happen.
Does anyone know what causes this or what would solve it?
Stu Smith - 23 Nov 2004 16:40 GMT
> I'm creating forms dynamically and their contained controls
> programmatically,
[quoted text clipped - 6 lines]
>
> Does anyone know what causes this or what would solve it?
If I remember it's caused by closing a form by setting Visible to false, or
by calling Close(). Forms should (bizarrely in my opinion) be closed by
assigning the DialogResult property.
Stu
paulm@protronics.co.uk - 23 Dec 2004 11:10 GMT
> > I'm creating forms dynamically and their contained controls
> > programmatically,
[quoted text clipped - 12 lines]
>
> Stu
Herfried K. Wagner [MVP] - 23 Nov 2004 19:31 GMT
"Tim Latham" <paulm@protronics.co.uk> schrieb:
> I'm creating forms dynamically and their contained controls
> programmatically,
[quoted text clipped - 4 lines]
> regardless of the screen position of the upper form. With some forms
> it does not happen.
This is not caused by adding your controly dynamically because that's what
the forms designer is doing too... I feel sorry, but I don't know the
reason for the flashing ;-).

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/
Serg - 23 Nov 2004 22:21 GMT
Make sure that there is nothing in the logic of your code that causes the
flashing forms to be loaded more than once. That would give appearence of
flashing. Another thing that might work would be suspending layout similar to
how the framework does when it generates code.
> I'm creating forms dynamically and their contained controls
> programmatically,
[quoted text clipped - 6 lines]
>
> Does anyone know what causes this or what would solve it?