hi all,
I have multiple groupBoxes that are visible or not depending on some selection done in the GUI. Instead of coding each groupBox and set them as visible or not, i was wondering if there was a way to get all those groupBoxes, like in (pseudo-code to illustrate)
foreach ($group in $form.groupBox){
if ($group.name -eq $nameOfGroup) {
$group.visible = $true}
else {
$group.visible = $false
}
}
thanks!
get list of a specific control in my GUI
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
get list of a specific control in my GUI
Code: Select all
$form.Controls | Where-Object{ $_.GetType().Name -eq 'GroupBox'}
Re: get list of a specific control in my GUI
Code: Select all
$form.Controls | Where-Object{ $_.GetType().Name -eq 'GroupBox'}