Home All Groups Group Topic Archive Search About
Author
23 Nov 2004 2:12 PM
Tim Latham
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?

Author
23 Nov 2004 4:40 PM
Stu Smith
"Tim Latham" <pa***@protronics.co.uk> wrote in message
news:db7edfb4.0411230612.7956db2b@posting.google.com...
> 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?

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
Author
23 Dec 2004 11:10 AM
paulm
Stu Smith wrote:
Show quote
> "Tim Latham" <pa***@protronics.co.uk> wrote in message
> news:db7edfb4.0411230612.7956db2b@posting.google.com...
> > 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?
>
> 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
Author
23 Nov 2004 7:31 PM
Herfried K. Wagner [MVP]
"Tim Latham" <pa***@protronics.co.uk> schrieb:
> 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.

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 ;-).

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
23 Nov 2004 10:21 PM
Serg
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.


Show quote
"Tim Latham" wrote:

> 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?
>

AddThis Social Bookmark Button