We have all been there, one time or the other, i.e. having to wire up into the stock .NET ListBox control to owner-draw the items per our needs, only to find very soon that:
Our CheckedImageListBox .NET control is specifically designed to completely remove the hard and complex work around the above described core issues such that you will never need to tackle them yourself, and in addition, also provide an extensive User-interface rich features such that your code simply sets the appropriate properties in the control and get the much desired UI you always wanted to have, without ever having to worry about the intricacies of making the features yourself.
What is the CheckedImageListBox .NET control
CheckedImageListBox .NET control is a custom written WinForms .NET Listbox control that presents your data items in a list-box style display, and in addition provides may extended modern User-interface features, including...
Advanced ListBox User-interface
The control is designed from ground-up to provide an exciting rich modern User-interface to display list of data items.
The anatomy of the control includes:
The control supports automatic Multi-line text for Item content text and title text.
The control provides for rich customization of its user-interface on various counts, including:
Customizable Item side-bar drawing
The control supports drawing a sidebar on the item whenever the mouse pointer is moved over an item or when a given item is currently in selected state.
This gives the control, a very modern look-and-feel and also adds to the nice overall aesthetic effect.
The customization feature allows you to specify many aspects for drawing the side-bar:
The sidebar feature is optional, so it can be switched off by setting the appropriate property value to false.
The items in the control can be displayed in two different modes, Full_view and Partial-View mode.
The Full-view mode is where the control renders the full contents of all the items displayed in the view.
In Partial-view mode, the control renders like so:
When in partial-view mode, the control displays the most important content items from the items that are currently in partial view.
These most important content items being:
The partial-view mode helps in many ways:
Automatic different sized item rendering
The control automatically works out the correct item content width as appropriate for each item, depending on the UI artifacts that it needs to render for each item, i.e. whether the control is currently rendering Item image, checkbox, or Mouse-hover annotation (at the right-hand), and accordingly depending on the correct width available, it renders the item content text in the available space.
In the screen-shot below, it can be seen that item 0 (title 0) does not require the side bar, or the mouse hover-annotation image, and accordingly has more space to render the content text, but item 2 (title 2) is currently mouse-hovered, and hence has less space for rendering its content text (after allowing for the sidebar and annotation image space).
The control works out the available space for each item, and renders its content text using as much space available to it (subject to the string formatting setup that you may have setup in the control, of course).
Items building with simple strings and content format customization
The control is extremely simple to setup its items, even with standard string items as its content.
It will take your string items and format it according to your custom string format setup that you can supply to it, and it will autoamtically do all the heavy lifting to render the selection/hover/de-selection rendering user-experience with the default built in drawing setup, so that its ready to use straight out-of-the-box.
In the screen-shot below, we can see a sample screen where the control was instantiated and its items setup just by using its Items collection property, and its all ready to use. Its that simple!
You could also, optionally, as can be seen from the code screen-shot below, customize the string format of the content for items and the control will use that to render the text.
Built-in Alternate Items drawing feature
The control provides built-in feature of drawing alternate items with different colors.
With this feature, you can setup the colors (start color and end color) and gradient factor to apply for the color brush to draw the alternate items.
In the screen-shot below, we can see a sample screen where the control is setup to draw alternating colors for items, and the simple code to set the relevant properties.
Advanced design-time capabilities
A custom designer class is implemented as part of the control library which allows design-time interaction with the control (i.e. while the control is in the design mode in the Visual studio IDE designer) features, including:
Extensive and simple to use customization properties and Method APIs
The control exposes numerous properties and method APIs to let you customize the control's look-and-feel to your heart's content.
You can see from the screen-shots below, a sub-set of a wide range of properties that you can use to customize the control heavily.
Almost every User-interface aspect can be custom configured.
Extensive events to subscribe
The control exposes numerous events that you can subscribe to and custom handle in your applications.
The event parameters gives you a wide range of information that you can use in your custom handler code.