MDI Child Icon

joe_pool_is

Contributor
Joined
Jan 18, 2004
Messages
507
Location
Longview, TX [USA]
I'm tackling my first MDI project.

I have my MDI child loading up fine in my MDI parent. The parent has an icon and I assigned the same icon to the child so that they match.

Now, if I maximize my child, it fills the parent, but the main menu gets large and includes the icon of the child - only bigger.

Whoops! Not what I wanted.

How do I fix this? Does the child form need a special FormBorderStyle property? Currently, I have it set to Sizable.
 
The icon is duplicated because the MDI child icon always appears on the left edge of the menubar when the MDI child is maximized. The fact that it is scaled, I'm guessing, is caused by a menubar that is larger than the default size. You could consider setting the Icon property to null when the child is maximized and restoring it when the form is restored.
 
I tried setting it to null, and I got Visual Studio's default icon there instead.

After fooling around with it for a while, it looks like it shows the icon in whatever size the icon actually is. I had loaded a 32x32 icon, which displayed nicely on the form, but grew to its full size whenever I maximized it.

I replaced that icon with a 16x16 icon, and it looks ok. I'll keep it! :)

For the record: MDI forms are a lot of work! Expecially with activating the MainMenu items, creating delegates to handle click events, and finding out how/when to activate the Cut/Copy and Paste items on the toolbar.
 
Back
Top