MDI Child Forms are FLASHING@!!!

P

Paul Loveless

Hi all. I'm developing a simple mdi application that has sizeable child
forms. In the parent window, there is a menubar with a 'Window' menu. I've
set the 'Window' menu MDIList property to true so that it will display a
list of open child windows at runtime. When I run the program to test its
functionality, I open several child windows. I then maximize one of the
child forms to fill the parent window. When I select a different child
window via the list of child windows displayed under the 'Window' menu, the
new child window will briefly flash on the screen. I suspect that it is
maximizing. However, when I select another child window that has already
been maximized, the brief flash still occurs. This flash occurs regardless
of whether or not I am running a debug or release version of the program
through visual studio or the stand-alone exe file.

Is there a way to programmatically stop this flashing effect? I've tried
different ideas, but none have been successful. I know that the flashing
does not affect the functionality of the program, but it is mildly annoying.

Each child window is created and opened with the following code:

private void mnuFileNewChild_Click(object sender, System.EventArgs e)
{
MDIChild newChild = new MDIChild();
newChild.MdiParent = this;
newChild.Show();
}

MDIChild is the class name of the child form which is nothing more than a
simple form that consists of some controls to help illustrate the flashing
effect and the stock pre-generated form code.

Thanks in advance for any responses.
Paul
 
M

Mike Lundell

Is MDIChild a form that has already been created? It could be flashing if
you
are creating a completely new form called MDIChild but if it's just an
instance
of MDIChild that has already been created then i'm not sure.

I created forms (that were my child forms) then loaded them the same way you
did

// inside a menu item click event
Permissions p = new Permissions();
p.MdiParent = this;
p.Show();
 
P

Paul Loveless

Hey Mike. The MDIChild forms are all instances. I downloaded a few other
examples of mdi applications written in .net by other people, and the flash
is definitely present. Remember, it occurs when you maximize one of the
child forms and then you activate a different child form through the
'Windows' menu list of open child forms. If there are alot of controls on
each child form, the flash is more pronounced. Has no one else seen this
effect, but me? I looked at Microsoft Excel which functions similarly in
this respect and there is no flash between switching windows. It seems to
affect all .net mdi applications. Either there is some code that I'm missing
that would eliminate the flash or its something we all have to live with.
Personally, I feel that the flash effect detracts from the professionality
of the program - and it just bugs me. On my own time, I'm going to try to
investigate it further. It may be possible to do something outside of the
..net environment, but I'm not very familiar with win32 api programming. If
you like, I can keep you appraised of any solution I find.

Or maybe its just my fluky machine.
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top