repainting the screen when switching from formmax to formnormal

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
 

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