Form postion on Desktop.

j88 used Ask the Experts™
Hi Experts!
  please help me code to set form on start with position: right-bottom of screen (desktop) but above Taskbar

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Set the form style to fsStayOnTop
and then onShowForm event do this:


sorry I think I misunderstood your question.
If you need to place your form just above the taskbar, you will need to find out the info about the rect that represents the taskbar. For this you need to call this:
   Wnd:=FindWindow('Shell_TrayWnd', nil);
// now you have the top and bottom of the TaskBar, rct.Bottom

All you need is use them to position your form
Wim ten BrinkSelf-employed developer
Just an interesting remark... On my system this would fail. Why? Because I've moved my taskbar from the bottom to the left of my screen, and also made it auto-hide itself.
I've also hidden all icons on my desktop and added a toolbar to my taskbar which holds the desktop items. And because the taskbar is on the left side, it displays quite a bit more icons to me when it's visible. I have over 100 icons on my taskbar!

The code by calinutz should work just fine, though. Just keep in mind that for some users, the taskbar might be in a location where you would not expect it...
Forced accept.

EE Admin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial