DeployCenter
This commit is contained in:
commit
7c724d475e
14 files changed
+2460
No files matched your search
@@ -0,0 +1,22 @@
|
||||
function Set-DeployCenterButtonStyle {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][System.Windows.Forms.Button]$Button,
|
||||
[Parameter(Mandatory=$true)][System.Collections.IDictionary]$Theme,
|
||||
[ValidateSet('Button','PrimaryButton','DangerButton')][string]$Role = 'Button'
|
||||
)
|
||||
$style = $Theme[$Role]
|
||||
$Button.BackColor = $style.Background
|
||||
$Button.ForeColor = $style.Foreground
|
||||
$Button.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat
|
||||
$Button.UseVisualStyleBackColor = $false
|
||||
$Button.FlatAppearance.BorderSize = 1
|
||||
$Button.FlatAppearance.BorderColor = $style.Border
|
||||
$Button.FlatAppearance.MouseOverBackColor = $style.HoverBackground
|
||||
$Button.FlatAppearance.MouseDownBackColor = $style.PressedBackground
|
||||
if (-not $Button.Enabled) {
|
||||
$Button.BackColor = $style.DisabledBackground
|
||||
$Button.ForeColor = $style.DisabledForeground
|
||||
}
|
||||
}
|
||||
|
||||
Export-ModuleMember -Function Set-DeployCenterButtonStyle
|
||||
Reference in new issue
Block a user