Hi,
Is there a way to have the form for a Powershell Studio project open in right bottom corner?
The idea is to have it opened when a systray icon is clicked, then opened just above a systray icon (other question I asked in these forums).
Thanks!
S
Have form in right bottom corner?
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.
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.
Re: Have form in right bottom corner?
You can create and launch a form from an icon event. Look at the Sapien blog posts for more details.
Here is one: https://www.sapien.com/blog/2017/07/10/ ... owershell/
And another: https://www.sapien.com/blog/2019/01/10/ ... lications/
Here is one: https://www.sapien.com/blog/2017/07/10/ ... owershell/
And another: https://www.sapien.com/blog/2019/01/10/ ... lications/
Re: Have form in right bottom corner?
Thanks, but how do I position the form in the right bottom corner above the systray?
Re: Have form in right bottom corner?
Did that, entered location 2760; 910 and have set startposition manual in form. That works for my screen but when I open the form/exe on another computer it is no visible (range problaby out of screen).
Re: Have form in right bottom corner?
Yes, that's what you said, but I have no clue howto do that besides entering what I did.
Re: Have form in right bottom corner?
Get the current screen size and just use basic arithmetic to calculate the new location of the top corner relative to the lower right corner of the screen or relative to any object on the screen.
Re: Have form in right bottom corner?
Thanks but again no clue. Googled compute form location powershell and similar other terms but I have nothing to start with.
Re: Have form in right bottom corner?
Get the current screen coordinates. Work from there.
[System.Windows.Forms.Screen]::PrimaryScreen.Bounds
$form.Bounds
[System.Windows.Forms.Screen]::PrimaryScreen.Bounds
$form.Bounds