|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Forms flashI'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? "Tim Latham" <pa***@protronics.co.uk> wrote in message If I remember it's caused by closing a form by setting Visible to false, ornews: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? by calling Close(). Forms should (bizarrely in my opinion) be closed by assigning the DialogResult property. Stu 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 "Tim Latham" <pa***@protronics.co.uk> schrieb: This is not caused by adding your controly dynamically because that's what > 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. 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/> 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? > |
|||||||||||||||||||||||