Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 528

PowerShell GUIs • Re: Calculating bottom right of screen to position

$
0
0
this is working for me but would still like to se eif anyone else has a better way of doing it

Add-Type -AssemblyName System.Windows.Forms
$AllScreens = [System.Windows.Forms.Screen]::AllScreens
$Primary = $AllScreens | ? Primary -eq $true
$Width = $Primary.Bounds.Width
$Height = $Primary.Bounds.Height

$x = $Width - ($Width / 7)
$x = ([Math]::Round($x, 0))

$y = $Height - ($Height / 4)
$y = ([Math]::Round($y, 0))

$form1.Location = "$($x),$($y)"

Statistics: Posted by halexand_sfwmd — Fri Jan 12, 2024 6:59 am



Viewing all articles
Browse latest Browse all 528

Trending Articles