simple windows mobile forms question

I using Windows Mobile 5.0 and expect the application's forms to only be open one at a time.

From the main form I have code like...

private void uioptionsmenuitem_Click(object sender, EventArgs e)
{
Options options = new Options();
//options.Parent = this;
options.ShowDialog();
}

I notice that when I bring up the task manager I have multiple windows showing up when I only expect one to show for my currently running application.

For example, if I have FormA with the code above and I click on the menu item, I then see FormA and the Options form in the task manager. I only expect to see the Options form in the task manager. What do I need to change



Answer this question

simple windows mobile forms question

  • Peter D. Falco Jr.

    Perhaps, something like this would do:

    private void uioptionsmenuitem_Click(object sender, EventArgs e)
    {
    Options options = new Options();
    //options.Parent = this;

    this.Hide();

    options.ShowDialog();

    this.Show();

    }



  • mcoulton

  • wpvanv

    As far as I know, the behavior you observe is due to the fact that in the .NET Compact Framework

    all forms are top level windows.

    If you’re going to use your application only on Pocket PCs and Smartphones, then you can set the title of the main form to an empty string. In this way, name of the form will not show up in the list of running programs.

    For example:

    this.Text = “”;

    options.ShowDialog();

    this.Text = FormTitle; // restore the title

    Hope this helps.

    Thank you,

    Sergey.


  • simple windows mobile forms question