Olavo
Olavo

Reputation: 23

how to maximize a windows mobile window?

how to maximize a windows mobile window ?

Upvotes: 2

Views: 1425

Answers (3)

karthi
karthi

Reputation: 21

Try this:

this.Width = Screen.PrimaryScreen.Bounds.Width;
this.Height = Screen.PrimaryScreen.Bounds.Height;

It works fine.

Upvotes: 0

MusiGenesis
MusiGenesis

Reputation: 75346

You might be asking about how to make a Windows Mobile form take up the entire screen. To do this, set the form's FormBorderStyle to None, and set the WindowState to Maximized. Also, delete the menu bar if one has been automatically added by the designer.

If you're trying to make a sort of "kiosk" app that involves multiple forms, you'll run into an issue when you switch forms within the application: the start bar will flicker back up for a split second each time. There is a way around this using the Win32 API, but it's a pain.

Upvotes: 2

ctacke
ctacke

Reputation: 67178

By default Windows Mobile will always maximize a normal FOrm (and strip off the caption bar). If you have a non-maximized dialog, then it's being shown via ShowDialog(). If that's the case, the simplest mechanism is to just resize the Form in OnActivate to be the screen dimensions. Something along these lines:

protected override void OnActivated(EventArgs e)
{
    base.OnActivated(e);

    this.Width = Screen.PrimaryScreen.WorkingArea.Width;
    this.Height = Screen.PrimaryScreen.WorkingArea.Height;
}

Upvotes: 1

Related Questions