Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 10 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
OK I am parsing a list of AD groups the user is a member of stored in an array $existingGroup.
In the foreach loop $item in $checkedlistbox1.CheckedItems, if $item matches the $group in the array $existingGroup (they are named exactly the same) I then wish to uncheck the corresponding check box with the same name as the AD group.
I have echoed out if there is a match so I know it is finding the group / checkbox that are the same. I cant appear to get the mechanism to remove the check.
OK I am parsing a list of AD groups the user is a member of stored in an array $existingGroup.
In the foreach loop $item in $checkedlistbox1.CheckedItems, if $item matches the $group in the array $existingGroup (they are named exactly the same) I then wish to uncheck the corresponding check box with the same name as the AD group.
I have echoed out if there is a match so I know it is finding the group / checkbox that are the same. I cant appear to get the mechanism to remove the check.
That make better sense?
Thanks,
Barry
How do you know which element of the array is the one you want to match. You can only match one to one. What is the criteria? What is it that you are trying to accomplish?
The checked boxes will check and uncheck automatically if set to do so. If you want to remove a check then use David's suggestion of enumerating the indices and then match the item
This topic is 10 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.