Multiple forms and "active programs"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Windows Forms app. There is a main form, which
had buttons/menus to spawn sub-forms. I launch the sub-
form, from the main form "Click" handler for example, by
calling:

FormChild formChild = new FormChild();
formChild.ShowDialog();

The child form shows up fine, in full-screen.
However, when I look at the active programs, I see both
forms listed and can "activate" the main form. How do you
spawn a child form and have it -- and only it -- show up
in the "active programs" list?

e.
 
The "Activee progrms" list on the PPC actually just enumerates all the open
windows. It doesn't matter if all the windows are from the same app, it will
have an entry for each one. What you can do is clear the caption of the
current form before showing the new one. The "Active Program" list will not
show forms that have no caption. I have a static class that I use to hold
the application's name and I use this to reset the form's title after the
subform is closed.

Example:

FormChild formChild = new FormChild();
this.Text = "";
formChild.ShowDialog();
this.Text = GlobalVars.AppName;

- Mark
 
Back
Top