Results 1 to 9 of 9

Thread: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Wiltshire, England
    Posts
    211

    Question form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    Hi,

    I have an app where several forms may be opened from different parents and when I close the child form I need to go back to the parent form. To do this I always open a form using show(Me) and that way I know who the owner( aka parent) of the child form was. The only problem is that any form I open using show(Me) does not appear in the Applications list, but will appear in the taskbar if that proeprty is set or not. I can work round this by minimizing the parent before I open the child and make sure the child form has ShowInTaskbar set to false (so don't end up with lots of buttons in taskbar for same application, but this is not ideal as you can then right click on the button in the taskbar and restore the parent window so it can be seen again. If I do a me.hide before opening the child window then the parent won't appear in the taskbar or application list in Task Manager and then have no way to switch to the application if I've switched away from it.
    Can anyone suggest a better way of doing this.
    I like having the ability to pass the owner of a form to the child, but it does have unwanted side effects.

    Thanks

    Kristian

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    You should be calling ShowDialog, which displays the form as a modal dialogue, rather than Show.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Wiltshire, England
    Posts
    211

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    Hi,

    Thanks for the suggestion - Having the form as a modal dialog helps in that the user can't switch to the parent form, but it is still there.
    What I want is there to always be one entry in the taskbar for the app, only 1 visible window and only 1 entry in the application list of task manager.
    How can I hide the parent window while keeping all my above requirements?

    Thanks

    Kristian

  4. #4
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    An owned form is always minimized or hidden together with its owner. Usually that's considered a blessing because it's hard to get that behaviour any other way. Would it meet your needs to pass the identity of the main form as the Tag property of the secondary form instead of as the Owner?

    BB

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Wiltshire, England
    Posts
    211

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    Hi BB,

    I didn't want to set some unused property to indicate the parent, but I guess I might have to - normally I just have a bunch of hidden controls on a form with information passed from the previous form.

    Thanks

    Kristian

  6. #6
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    If you don't want the child forms to be showing in the taskbar, set its ShowInTaskbar property to false. If you use ShowDialog(Me) to open it, then clicking the parent form's taskbar icon will bring the child form to the front of the screen.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Wiltshire, England
    Posts
    211

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    Hi JB,
    What you describe I can achieve as you describe, but the problem I get when doing this is when I use showdialog(me) rather than just showdialog (or show) there is no entry for the VB app in the Application List of Task Manager.

    Kristian

  8. #8
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    I think I follow what you're after now... you want every form to show in the Alt+Tab & the Win+Tab sequences but you don't want them to have a taskbar icon?

    I'm not able to reproduce your problem either. I created a new project and added a 2nd form, set it's ShowInTaskbar to false and when I show the form, it does not have a Taskbar icon but it does show in the Alt+Tab list.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Jul 2012
    Location
    Wiltshire, England
    Posts
    211

    Re: form_name.Show(me) and app not appearing in "Applications" list in Task Manager

    Hi,

    I think I've got what I need now - when opening the child form I call this code:
    Me.WindowState = FormWindowState.Minimized
    frmNon_Titration.Show(Me)
    Also every child Window has showintaskbar set to false so only the parents entry shows and I won't get more than one entry. if I use 'me.hide' instead of 'Me.WindowState = FormWindowState.Minimized' then as well as hiding the form from the taskbar it also hides it from the Application List in Task Manager which was the problem.

    Thanks for all your help.

    Kristian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width