repainting the screen when switching from formmax to formnormal

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

I have an mdi container that is opened max. Inside can be zero or dozens of
child forms. One of the forms - my reporttree - is to be opened normal; all
others maximized. When you have the reporttree opened and you open another
on top of it, that's fine, but when you switch to the reporttree, I have the
following code in a timer loop inside my mdi container:
Dim child As Form

For Each child In Me.MdiChildren

If child.Name = "reporttree" And child.WindowState =
FormWindowState.Maximized Then

Application.DoEvents()

child.WindowState = System.Windows.Forms.FormWindowState.Normal

Application.DoEvents()

Exit For

End If

Next

Here's the problem: the other form(s) are now normal, which is fine, but the
mdi container background is not repainted, so you see remnants of the
'other' window(s) screen all over the place. Any way to solve this?

Thanks for any help.

Bernie Yaeger
 
Back
Top