I’m working on a graphical tool with PowerShell Studio 2012 where the user can choose stuff with checkboxes.
First I used the checklistbox Control.
Works nice if you don’t want Groups, but I want that!
Group One
Checkbox One
Checkbox Two
Checkbox Three
Group Two
Checkbox Four
Checkbox Five
Checkbox Six
Group Three
Checkbox Seven
So I ended up using the ListView Control instead of the checklistbox Control.
But the way to a nice ListView with groups of checkboxes was not as easy that you can think.
A standard ListView with Seven items looks like this:
Easiest way to add items is to go to Properties -> Items and click (Collection) …
And when adding checkboxes it will look like this:
Under properties you will find CheckBoxes. Default setting is False.
Change it to True.
I want my Checkboxes on the left side:
In properties change Alignment to Left:
But I want the checkbox on the left side of the text.
So I desided to change it from Large Icons to Small Icons and It seems ok.
And now I start to fix the Groups.
Under Items we need to assign Groups to the Items.
And here is the result of this:
Not as nice as I hoped for.
I played around with this for a while and found out how to solv it.
The Detailed view is the right view with Groups and checkboxes, not the Small Icon view.
But as default it looks like this:
So I ended upp creating a default column.
And now the ListView is as I wanted it!
I did not find any posts on this strange behavor on the internet.
But there are 3 nice blog posts on Sapiens blog about the ListView Control.
http://www.sapien.com/blog/2012/04/04/spotlight-on-the-listview-control-part-1/
http://www.sapien.com/blog/2012/04/05/spotlight-on-the-listview-control-part-2/
http://www.sapien.com/blog/2012/04/11/spotlight-on-the-listview-control-part-3/