Question Windows Taskbar - Can I prevent 2 different forms from stacking in the taskbar?

motoburn

Member
Joined
Jun 15, 2010
Messages
17
Location
Collinwood, TN
Programming Experience
Beginner
Good Morning,

I have a main form called frmMain from which all other forms and actions are launched. in the menu bar on frmMain there is a text box where the user can enter an inventory item number. This shows a new instance of frmBundleSearch.

This frmBundleSearch may get multiple new instances opened at a time.
What I would like to see is the frmMain in the taskbar separate from the frmBundleSearch when it has enough open instances to begin stacking in the taskbar.

Right now, when I debug, when the taskbar starts stacking the application's forms, all of them are in the same stack, so right-click and "Close All" nukes the whole app. Is it possible to keep them separated?

thanks,
Chris
 
The stacking of programs happens in windows not your apps. In Vista and older it'll do the stacking thing only when the TB gets full, in Win7 the default behavior is to stack the windows/programs behind the icon which can be turned off. What you could do is set the form's ShowInTaskbar property to false and let Win7 show the window preview for all of the windows and the icon only has the 1 window behind it (no stacking).

You could even have the ShowInTaskbar set to false if the program is running on a Win7 or newer computer, you can use these to determine whether it's Vista/older or Win7/newer:
Environment.OSVersion.Platform
Environment.OSVersion.Version.Major
Environment.OSVersion.Version.Minor
 
Thank you for the quick response. I am building this app for our office as the front-end to our db. We are all running XpPro sp3 and I doubt there will be any upgrading done in the near future.
So if xp handles the stacking... does that mean that as long as a form in my app is marked as ShowInTaskbar=True then they will all stack as one? If so, the users will just have to not "close all" from a right-click.... right?

Sorry, I am learning all this as I go, but we desperately need to get away from MS Access.. :)
 
What I was saying is that XP will "stack" your programs open windows if the taskbar gets full. So if the user's taskbar only has 3 items on it (3 of your app's windows) then each will be it's own item on the taskbar. If you don't want to have a window in your program show in the taskbar then you can set it's ShowInTaskbar property to false and when that window is showing on the screen, you wont see an item for it in the taskbar.
 
Yes, what I see happening is my user may lookup say 5 or 6 items and keep them open for a bit, but at the same time, they will have Outlook, Excel, Peachtree, Firefox, and probably a few other forms from my app open (this is roughly what I tried to simulate in my debugging). I wanted to see about making the frmBundleSearch show up as a different app in the taskbar, but it doesnt appear to be feasible.. :) thank you for the clarification on this.
 
Since it's being ran on XP machines, you could set the title's of the various instances to different text (to keep one frmBundleSearch different from another).
 
I set the .text of the frmBundleSearch to a string of data from the database so each is unique (unless they look up the same one twice).

At this point, I am just concerned about potential processes that may be only half complete (half edited records... or manual data entry that has not been saved) getting messed up if they close the stack. I may remove the controls from frmMain, or atleast the close button... not sure :confused:
 
Back
Top