Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Childform doesn't start maximized 1

Status
Not open for further replies.

Kostarsus

Programmer
Nov 30, 2000
86
0
0
DE
Hi all,

I want to write an application, where the childform ist maximized at start. The MDI container starts maximized, when I call my code.
If I remove the MDI relation, the form mapWindow starts maximized, but if I set the MDI container, the window starts in state normal.
I use this code:

Code:
                MapWindow mapWindow = new MapWindow();
                mapWindow.WindowState = FormWindowState.Maximized;
                mapWindow.MdiParent = this;

                mapWindow.Refresh();
                mapWindow.Show();

Can anyone tell me, where is the error?
Thanks in reguards
Kostarsus
 
what if you set the WindowsState to the parent's windows state value. Would that do anything?

you have need to write it like this though
Code:
mapWindow.MdiParent = this;
mapWindow.WindowState = mapWindow.MdiParent.WindowState

Notice that I am setting the parent first (flipping your code around)

Or maybe the refresh is causing your headache. Can you try with out that?
 
Thanks the order of the commands was the clue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top