Owner Drawn Controls - Extendable ListBox
This is the first in a series of Owner Drawn control How-tos. The object is not to make a glitzy control
with a bunch of bells and whistles, that is left to your imagination, but to demonstrate one way to
create your own Owner Drawn ListBox control. This control is different from the other derived ListBox
controls that I've seen on CP in that this allows the items to be in either a collapsed or extended
state. In other words, when you click on an item, it toggles the item view so that it can be minimized
or maximized, allowing for additional information to be viewed when maximized. In the screenshot,
the "Just Chill Man!" item is extended, all others are collapsed. For this demo, I have created an
ExtendedListBoxItem class, derived from an object that is used to maintain information about the item,
and contains the methods DrawCollapsed, DrawExtended, DrawBorder, and AddGlow. This class is only a
template to show what is possible and a beginning point for building your own item class. I'm sure
that once these skills are mastered, you will be able to create a bigger, badder, better ListBoxItemControl
class that will serve your particular needs.