Preventing a form from disappearing while the user is working in another form

Joined
Sep 3, 2008
Messages
19
Programming Experience
1-3
I have written a VB.Net program consisting of 10 forms. On the main form used in the application, when the user presses one of the keys on the main form, another form will appear on top of the main form. When I click back on the main form while the second form is being displayed, the second form disappears (i.e. minimized to taskbar). How can I prevent the second form from disappearing? That is, I would like to have both forms appearing on the screen even when I click on the main or second form.


Thanks.
 
There are three ways to make this happen:
  1. show as dialog
  2. configure as tool window
  3. configure as topmost window for all applications
Here's how:
  1. Use the ShowDialog method to show it.
  2. Configure the second form to be a Tool window by adding it to owner forms OwnedForms collection, or setting Owner property for the second form. Such a form should also have FormBorderStyle set to fixed/sizable Tool Window to give the user the immeadiate visual cue what this is, and ShowInTaskBar set to False. Owned forms "follow their leader" by closing when owner closes and minimize/restore along with the owner form.
  3. Set the TopMost property to True.
 
Unless I misunderstood Super Daves question, he wants the dialog form to always be visible but also allow the user to access the main form at the same time.

JohnH has left a few options (including the form topmost property) but using the Form.ShowDialog option will keep the new form on top but not allow the user to access the main form until it is closed.

Setting the Form.TopMost property to True would be the correct option out of the several JohnH has listed and will accomplish both keeping the form always visibile and also allowing the user to still access the main form.
 
Given the information by the original poster, without knowing more details, I would set things up as a tool window before just setting the TopMost property.

Also seeing as how it's been 2 weeks since this thread was created and the O.P. hasn't posted here since, I'm pretty sure (s)he's found the answer they were looking for.
 
Back
Top