Multiple forms and "active programs"

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.
 
M

Mark Reddick

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
 

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