Docking or floating PowerShell Forms

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jreinblatt
Posts: 6
Last visit: Mon Oct 11, 2021 3:16 pm

Docking or floating PowerShell Forms

Post by jreinblatt »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowerShell Studio 2018, Version 5.5.152
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 Enterprise
32 or 64 bit OS: 64 bit

*** Please add details and screenshots as needed below. ***
I'm looking to create a form that you can choose whether to: float it (allowing people to move the form where they want it), dock across the top of the monitor screen, or at the bottom of the monitor screen above the taskbar. This is one area I haven't trodden yet, any help or pointers are appreciated.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Docking or floating PowerShell Forms

Post by davidc »

[TOPIC MOVED TO POWERSHELL GUIS FORUM BY MODERATOR]

Windows docking functionality is usually handled by the OS. If you wish to remember a Window's position, you will need to store that information somewhere on disk or in the registry and restore the Form's previous position on load.
David
SAPIEN Technologies, Inc.
User avatar
jreinblatt
Posts: 6
Last visit: Mon Oct 11, 2021 3:16 pm

Re: Docking or floating PowerShell Forms

Post by jreinblatt »

thank you!
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Docking or floating PowerShell Forms

Post by jvierra »

There is no built-in way to do this. You can lock the form so it is not movable and set it's location. This will accomplish much of what you seek however, there is no way to prevent other app Windows from popping up on top of your form.
This topic is 5 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked