maximize child window, restore icon and toolbar problem

J

Julia Lerman

i have a problem which I have only seen one reference to. That reference is
not dated, but indicates that it is a problem with Visual Studio. Hopefully
by now (vs2003) it has been fixed but I can't find the solution.

I am working with an MDIParent and only one child at a time.

The parent is resizable, and I want the child maximized so that it will
resize with the parent.

The child form WindowState property is set to maximized.

When the window opens, there is a "restore" icon on the upper left of the
mdi parent. It is under the mdi parent's title bar, but creates a space for
itself by pushing the mdiparent's toolbar down.

This is a horrible effect when the child is loaded.

There seems to be NO way to turn this functionality off. If I could get it
to merge into the toolbar, I can live with it.

I have googled this problem, searched in the forums, searched in the
wonderful Windows Forms FAQ's (thanks George Shepard) and looked in a number
of books.

It is the first time I have had to do MDI since I started programming in
..NET so it's my first time tangling with this.

Anyone know the solution?

Thanks

Julie Lerman
 
H

Herfried K. Wagner [MVP]

* "Julia Lerman said:
i have a problem which I have only seen one reference to. That reference is
not dated, but indicates that it is a problem with Visual Studio. Hopefully
by now (vs2003) it has been fixed but I can't find the solution.

I am working with an MDIParent and only one child at a time.

The parent is resizable, and I want the child maximized so that it will
resize with the parent.

The child form WindowState property is set to maximized.

When the window opens, there is a "restore" icon on the upper left of the
mdi parent. It is under the mdi parent's title bar, but creates a space for
itself by pushing the mdiparent's toolbar down.

This is a horrible effect when the child is loaded.

I don't have a solution, but if you add a menubar to the MDI container,
the toolbox of the child will be displayed as part of it.
 
J

Julia Lerman

yes - similar to vb6 behavior. Sadly, I have no need for the menu.
but thanks!!

julie (MVP, too!)
 
B

Bill Gates

It sounds as though you have run into an annoying bug with MDI child forms
that vexed me when I tried using them with Microsoft's UI Process
Applicatoin Block. I finally solved it in my MDI Parent container base from
as follows:

/// <summary>/// Kludge required because WindowsState = Maximized does not
work on initial load and must be

/// redone in order to render properly.

/// </summary>

public void Kludge()

{

// The following is a workaround for a MS bug related to .FILL initial value

Size sz = ClientSize;

ClientSize = Size;

ClientSize = sz;

}
 
B

Bill Gates

It sounds as though you are hitting a bug that I struggled with when
attempting to set MDI childforms WindowState to maximized for use with the
UI Process Application Block. I solved it in my MDI parent base form as
follows:

/// <summary>
/// Kludge required because WindowsState = Maximized does not work on
initial load and must be
/// redone in order to render properly.
/// </summary>
public void Kludge()
{
// The following is a workaround for a MC bug related to .FILL initial
value
Size sz = ClientSize;
ClientSize = Size;
ClientSize = sz;
}
 
J

Julia Lerman

hey Bill. So nice of you to communicate with us users. I didn't realize you
actually programmed too! Cool.
(no really - is that your real name?)

Anyway - I did try just doing a client resize myself but I didn't like that.
So I gave in and added a menu.

julie
 

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