Public/Disable-WFTabControl.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
function Disable-WFTabControl { <# .SYNOPSIS This function will disable a tab control .DESCRIPTION A detailed description of the Disable-WFTabControl function. .PARAMETER TabControl Specifies the TabControl control to disable .EXAMPLE Disable-WFTabControl -TabControl $TabControl .NOTES Francois-Xavier Cat @lazywinadm www.lazywinadmin.com github.com/lazywinadmin #> [CmdletBinding(SupportsShouldProcess = $true)] param ( [Parameter(Mandatory = $true)] [ValidateNotNull()] [System.Windows.Forms.TabControl]$TabControl ) BEGIN { Add-Type -AssemblyName System.Windows.Forms } PROCESS { IF ($PSCmdlet.ShouldProcess($TabControl, "Disable the TabControl control")) { $TabControl.Enabled = $false } } } #Disable-TabControl |