Force the "Modern Visual Style" on your GUI


If you have created a Powershell script using Windows Form, with PrimalForm for an example, this form may not appear as expected depending on where you launched this script. 

Indeed your Form could appear with an old interface, as below : 

To resolve this issue and force your form to be displayed correctly you have to add the line below to your script : 
[System.Windows.Forms.Application]::EnableVisualStyles() 

Now, your Form should appear as below :

Share this

Related Posts

Previous
Next Post »