Is there a way to change the UI colours?

Just wondering if there is a way to change the colours of the UI?
Thanks

image

To do that you’ll have to modify the Show-WelcomePrompt function.

Let’s say you want to change the grey background of this GUI, according to this it says:

You can use the ForeColor color property to change the default foreground color of all controls placed on the form.

The form here is the whole popup. And all the things on top are attached to the form.
The $formWelcome form object is declared with this line: $formWelcome = New-Object -TypeName 'System.Windows.Forms.Form'

But this block is where you will want to set the color:

## Form Welcome
$formWelcome.Size = $defaultControlSize
$formWelcome.MinimumSize = $defaultControlSize
$formWelcome.Padding = $paddingNone
$formWelcome.Margin = $paddingNone
$formWelcome.DataBindings.DefaultDataSourceUpdateMode = 0
$formWelcome.Name = 'WelcomeForm'
$formWelcome.Text = $installTitle
$formWelcome.StartPosition = 'CenterScreen'
$formWelcome.FormBorderStyle = 'FixedDialog'
$formWelcome.MaximizeBox = $false
$formWelcome.MinimizeBox = $false
$formWelcome.TopMost = $TopMost
$formWelcome.TopLevel = $true
$formWelcome.Icon = New-Object -TypeName 'System.Drawing.Icon' -ArgumentList $AppDeployLogoIcon
$formWelcome.AutoSize = $true
$formWelcome.Controls.Add($pictureBanner)
$formWelcome.Controls.Add($buttonAbort)

To change the grey to blue for example you could add $formWelcome.forecolor = [Drawing.Color]::Blue

Here is the list of colors

Good luck!

1 Like