Maximized windows minimize when loading

N

nzpcmad

The device I am developing on uses CE 4.10. It's default Compact
Framework is the RTM version.

I use Visual Studio 2003 and C# for development.

I have tried upgrading the device to both Compact Framework SP1 and
SP2 and both exhibit the same behavior. When I navigate between forms,
the form is always minimized on the taskbar rather than maximized.
Clicking on the taskbar icon loads the form as desired. This never
happened under RTM. Forms were always maximized.

I am using the "this.WindowState = FormWindowState.Maximized;"
construct.

Any ideas?

Many thanks
 
G

Guest

Try putting this.WindowState = FormWindowState.Maximized; in the form load event instead of the constructor.
 
N

nzpcmad

Sorry about the delay to respond...

I tried that and it made no difference. I did a bit more searching and
the code now looks like:

private void frmMenuContainer_Load(object sender, System.EventArgs e)
{
this.Menu = null;
this.WindowState = FormWindowState.Maximized;
}

private void frmMenuContainer_Activated(object sender, EventArgs e)
{
this.Menu = null;
this.WindowState = FormWindowState.Maximized;
}

Note: The Properties won't allow an "Activate" and it never
breakpoints here (I do have an Event setup) so the "Activate" is a bit
of a red herring.

The bottom line is that it still doesn't work on anything but RTM.

Any thoughts?

Thank you



Mark Arteaga said:
Try putting this.WindowState = FormWindowState.Maximized; in the form load event instead of the constructor.

--
Mark Arteaga, MVP
info_[at]_markarteaga_[dot]_com


nzpcmad said:
The device I am developing on uses CE 4.10. It's default Compact
Framework is the RTM version.

I use Visual Studio 2003 and C# for development.

I have tried upgrading the device to both Compact Framework SP1 and
SP2 and both exhibit the same behavior. When I navigate between forms,
the form is always minimized on the taskbar rather than maximized.
Clicking on the taskbar icon loads the form as desired. This never
happened under RTM. Forms were always maximized.

I am using the "this.WindowState = FormWindowState.Maximized;"
construct.

Any ideas?

Many thanks
 
N

nzpcmad

Update : After trolling through the group, I ended up with the
following code for the OnLoad event:

private void frmXxx_Load(object sender, System.EventArgs e)
{
this.WindowState = FormWindowState.Maximized;
this.FormBorderStyle = FormBorderStyle.None;
}

Now the windows are all maximised. However, what happens is that the
window is first minimized, then for a brief flash you can see the
desktop and then it is maximised - which doesn't look too flash - but
at least I can now upgrade to SP2.

Thanks



Sorry about the delay to respond...

I tried that and it made no difference. I did a bit more searching and
the code now looks like:

private void frmMenuContainer_Load(object sender, System.EventArgs e)
{
this.Menu = null;
this.WindowState = FormWindowState.Maximized;
}

private void frmMenuContainer_Activated(object sender, EventArgs e)
{
this.Menu = null;
this.WindowState = FormWindowState.Maximized;
}

Note: The Properties won't allow an "Activate" and it never
breakpoints here (I do have an Event setup) so the "Activate" is a bit
of a red herring.

The bottom line is that it still doesn't work on anything but RTM.

Any thoughts?

Thank you



Mark Arteaga said:
Try putting this.WindowState = FormWindowState.Maximized; in the form load event instead of the constructor.

--
Mark Arteaga, MVP
info_[at]_markarteaga_[dot]_com


nzpcmad said:
The device I am developing on uses CE 4.10. It's default Compact
Framework is the RTM version.

I use Visual Studio 2003 and C# for development.

I have tried upgrading the device to both Compact Framework SP1 and
SP2 and both exhibit the same behavior. When I navigate between forms,
the form is always minimized on the taskbar rather than maximized.
Clicking on the taskbar icon loads the form as desired. This never
happened under RTM. Forms were always maximized.

I am using the "this.WindowState = FormWindowState.Maximized;"
construct.

Any ideas?

Many thanks
 

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