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:
Image may be NSFW.
Clik here to view.
Easiest way to add items is to go to Properties -> Items and click (Collection) …
Image may be NSFW.
Clik here to view.
And when adding checkboxes it will look like this:
Image may be NSFW.
Clik here to view.
Under properties you will find CheckBoxes. Default setting is False.
Change it to True.
Image may be NSFW.
Clik here to view.
I want my Checkboxes on the left side:
Image may be NSFW.
Clik here to view.
In properties change Alignment to Left:
Image may be NSFW.
Clik here to view.
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.
Image may be NSFW.
Clik here to view.
And now I start to fix the Groups.
Image may be NSFW.
Clik here to view.
Under Items we need to assign Groups to the Items.
Image may be NSFW.
Clik here to view.
And here is the result of this:
Image may be NSFW.
Clik here to view.
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:
Image may be NSFW.
Clik here to view.
So I ended upp creating a default column.
Image may be NSFW.
Clik here to view.
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/