I’ve added control number 24 to the Toolkit called KryptonListBox.
This control encapsulates the existing WinForms ListBox control but performs custom painting to achieve the Krypton look and feel. Here you can see the control drawn using the Office 2007 – Blue, Office 2003 and System palettes respectively…

Drawing uses the double buffering technique when updating the display so that you no longer get that annoying flicker that occurs with the standard control. If you resize a Form containing a list box you will have noticed this rapid visual flickering, caused by the background being drawn before the list entries.
The control is implemented by using a container that draws the border and background elements and contains in the client area an instance of the ListBox. This has the advantage of allowing the border to have rounded corners and any other effects as required by the selected palette. Unfortunately it has the side effect and preventing the IntegralHeight functionality from working. Personally I do not see this as an issue as I’ve never found a use for this property.
Other properties not provided are ColumnWidth, MultiColumn and UseTabSpaces. These are not used because the text drawing is handled by the same internal class that performs button drawing. This internal class does not have the functionality required to implement the removed properties. However, it’s not all bad news. Instead of being limited to just showing text you can easily provide an additional string and image for display. Just like this…

Defining the additional item values is very simple. Just create instances of KryptonListItem and add them to the Items collection property. The control will notice that the item instance exposes the IContentValues interface and use that to recover the three values. If the interface is not found it reverts to the standard behavior of calling ToString() on the item object. If you prefer to use your own custom objects inside the collection then simply implement the IContentValues.
As with all Krypton controls you can alter the State properties to alter the appearance and manipulate the relative positions of the content values. So if you prefer both text strings right aligned with the image above the text, then you just need to alter the appropriate appearance properties to achieve it.
I hope that the addition of the KryptonListItem class will make up for the loss of the IntegralHeight and multiple columns capabilities that have been lost.
January 24th, 2008 at 10:24 pm
The combobox drops down a list box, will you be replacing the list box in the kryptoncombobox for this new listbox?
January 24th, 2008 at 11:05 pm
Not replacing it, but I will be looking into owner drawing the combo items so they have the same look as the list box items.
January 25th, 2008 at 12:45 am
Cool
January 25th, 2008 at 5:25 pm
Hey Phil!
1st of all: GREAT CONTROLS! I’ve been playing around with Krypton Toolkit for 3 days now and i love it!
Question: if you’re going to change the KryptonComboBox as mentioned, will it be able to display images like the new KryptonListbox here? (That would be fantastic)
January 25th, 2008 at 5:39 pm
[...] KryptonListBox – New Office 2003/2007 styled list box control added to this free to use control library. [...]
January 25th, 2008 at 6:38 pm
I will look into provided a short/long/image set of values for the combo box when I add the custom painting. Depending on how well it can be made to fit into the control determines if I add it or not.
January 28th, 2008 at 11:00 pm
When this component will be available?
January 28th, 2008 at 11:13 pm
In the next release.
January 30th, 2008 at 5:32 am
When will the next release be?
April 26th, 2008 at 9:15 pm
I wonder if you could use this in the Simple mode of the combo box. It doesn’t support Simple mode yet.