Wenn man eine Powershell GUI mit Windows Forms erstellt, kann es bei Bildschirmen mir hoher Auflösung dazu kommen, dass einige Elemente unscharf oder verschwommen sind.
Normalerweise lässt sich dies lösen in dem man Powershell sagt, wie sie mit solchen Bildschirmen umgehen soll.
$form.AutoScaleMode = "DPI" #alternative "font" statt "DPI"
Wenn das nicht funktionieren sollte, gibt es einen anderen Workaround, indem man folgendes am Anfang des Programms einfügt.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName 'PresentationFramework'
[System.Windows.Forms.Application]::EnableVisualStyles()
# Dummy WPF window (prevents auto scaling).
[xml]$Xaml = @"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="Window">
</Window>
"@
$Reader = (New-Object System.Xml.XmlNodeReader $Xaml)
$Form = [Windows.Markup.XamlReader]::Load($Reader
# Rest des Codes
$Form = New-Object System.Windows.Forms.Form