Dynamic MDI problems

G

Guest

Hi,

I'm creating a game dev kit where I need to switch between MDI and SDI mode.
MDI is used when displaying the IDE with editors etc, in SDI mode only the
"game" window is displayed, optionally with a few editors remaining open.

However, setting MdiParent once the child windows has been Shown() causes
strange refresh and focusing problems, e.g. a child window will not receive
focus when clicking on anything else than the title bar or resize borders.
It's very easy to recreate the problem; I can post the code if necessary.

I don't want to Close() the forms and re-open them, because there's a lot of
complex data in them that I don't want to have to serialize for loading at
re-load time.

Can I do anything about this?
 
G

Guest

Thanks, but I found a solution, or hack rather, but it works:

protected override void WndProc(ref Message m)
{
if (m.Msg == 33)
this.Activate();
base.WndProc(ref m);
}

Overall, I spend so much time fighting WinForms quirks that I'm considering
switching to wxWidgets or even Flash. Or WPF if it gets good penetration
quickly, I really hope so.
 
G

Guest

Thanks, but I found a solution, or hack rather, that works:
protected override void WndProc(ref Message m)
{
if (m.Msg == 33)
this.Activate();
base.WndProc(ref m);
}
I created a base class and inherit all my forms from there. Very ugly... It
really gets to me, all the time I'm spending on fighting WinForms quirks.
Hope WPF gets good penetration soon, so I can concentrate on my programs'
features instead of hair-pulling...
 

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