[2005] Form Always on top but not covering taskbar
Tried various methods from using setwindowpos to insert after the taskbar's handle to using setwindowpos to set my form always ontop and then the taskbar...as well as setting the form's property itself to always on top.
I cannot seem to find a way to set my form always on top but always behind the taskbar... (this is for a notification type software where it will need to raise up and display something from behind the taskbar, then return back to its origional position when complete).
any ideas?
Re: [2005] Form Always on top but not covering taskbar
This happens because the form is not allowed to be on top of the taskbar. Go to your taskbar, rightclick on it and select properties, there's a checkbox with the title "Always on top", uncheck it, and your form will get on top of the taskbar, simple as that!
[sarcasm mode]First time in my life I see Windows doing what it's supposed to do... :eek:[/sarcasm mode]
Re: [2005] Form Always on top but not covering taskbar
I suspect you mis understood what I requested.
I want my form to stay UNDER the task bar (not on top of it)
but on top of all other windows.
Re: [2005] Form Always on top but not covering taskbar
did you set the TopMost property of the form to true?
2 Attachment(s)
Re: [2005] Form Always on top but not covering taskbar
Yes Kleinma,
on startup i set the form in the lower left so that only the title (should) be visible and set the form to topmost (tried all the various ways including setting the form's property to topmost). how ever the form stays on top of the taskbar too (First Attachment).
I want it to be like the second attachment.
the form is about 600 pixels tall and scrolls up when you hover the mouse over it's title or the form itself.
1 Attachment(s)
Re: [2005] Form Always on top but not covering taskbar
i think the problem lies in the case when you have 2 TOPMOST windows.
TOPMOST window 1 being your app, and TOPMOST windows 2 being the taskbar.
when you have 2 topmost windows, they sit on all other windows, but they exchange focus when they are activated. Also you can't (at least not that I know of) specify for a window to be topmost but ALWAYS be behind another topmost. That would make it rather odd to work with that window, unless it did something like what you are after (scrolling the form up into view) but since keeping it out of view until needed is sort of like a hack(ish) way of doing things.. I don't think there is anything you can do about it.
I got curious about this so I made an example of an alternative that actually moves AND shrinks the form to keep it out of view.. it is topmost on all windows.. but shrinks instead of needing to go behind the taskbar...
let me know what you think.. its not perfect.. but should get you on your way.
Re: [2005] Form Always on top but not covering taskbar
Try this, it'll make the form 'all screen' size thus it should inculde the taskbar and be ontop of it
VB Code:
Me.Size = Screen.PrimaryScreen.Bounds.Size
Re: [2005] Form Always on top but not covering taskbar
Quote:
Originally Posted by kleinma
i think the problem lies in the case when you have 2 TOPMOST windows.
TOPMOST window 1 being your app, and TOPMOST windows 2 being the taskbar.
when you have 2 topmost windows, they sit on all other windows, but they exchange focus when they are activated. Also you can't (at least not that I know of) specify for a window to be topmost but ALWAYS be behind another topmost. That would make it rather odd to work with that window, unless it did something like what you are after (scrolling the form up into view) but since keeping it out of view until needed is sort of like a hack(ish) way of doing things.. I don't think there is anything you can do about it.
I got curious about this so I made an example of an alternative that actually moves AND shrinks the form to keep it out of view.. it is topmost on all windows.. but shrinks instead of needing to go behind the taskbar...
let me know what you think.. its not perfect.. but should get you on your way.
yes this is the only work around I was able to come up with as well (which is how the form has been from the start).
how ever I'm not quite satisified with the effects and the constant recalculation for form growth/shrinkage if the form needs to change dimensions.
thanks anyways though...