|
-
Apr 19th, 2013, 03:25 AM
#1
Thread Starter
Addicted Member
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
-
Apr 19th, 2013, 04:13 AM
#2
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.
-
Apr 19th, 2013, 05:14 AM
#3
Thread Starter
Addicted Member
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
-
Apr 19th, 2013, 05:43 AM
#4
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
-
Apr 19th, 2013, 05:55 AM
#5
Thread Starter
Addicted Member
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
-
Apr 19th, 2013, 09:24 AM
#6
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.
-
Apr 22nd, 2013, 04:03 AM
#7
Thread Starter
Addicted Member
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
-
Apr 22nd, 2013, 10:07 AM
#8
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.
-
Apr 23rd, 2013, 03:17 AM
#9
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|