Taste The Power – Gets Another BOOST

I was thinking about the ListBoxWithIndicator custom control I wrote for the upcoming Charlotte Developers GUILD Code Camp and wanted to add the ability to use a CheckBox instead of a path to indicate that the ListBoxItem was selected. The result would be a WPF CheckListBox.

I tried several different approaches to add this functionality to the ListBoxWithIndicator custom control but, all were leading to developer hackery.  So I authored the CheckListBox as a separate control and added this control and a demo of the control to the Taste The Power presentation.  I’ll write a Code Project article soon explaining how the control works.

To me what is super cool, is that the ListBox knows nothing about the CheckBox that displays to the left of it. Yet, when you click on either the ListBoxItem or the associated CheckBox the ListBoxItem.IsSelected property changes.

Another awesome feature is, that if the ListBoxItem’s width causes the ListBox to display the horizontal scroll bar and the user scolls, the CheckBox does not scroll out of view.  This same feature is also part of the ListBoxWithIndicator custom control.

This control was inspired by Josh Smith and his awesome teaching and code provided the means for this control to be authored. You can view Josh’s article here.

Please check out the demo and see a true WPF CheckListBox.

You can download the updated Taste The Power Presentation below.

YOU MUST - after using the below link to download the file, you MUST change the extenstion to .zip. This is a requirement of WordPress.com.

Updated Taste The Power Presentation

I hope you like this code and can learn a lot from it.

Almost forgot, the code is all VB.NET!

Have a great day,

Karl

Just a grain of sand on the worlds beaches.

Leave a Reply

You must be logged in to post a comment.