My goal is to create a "WindowsXP add/remove programs"-style listbox, where
the selected item is bigger (taller) than the others, and displays different
content when selected.
When the listbox's DrawMode property is set to OwnerDrawVariable (which mine
is, from design time), the MSDN docs tell me that the MeasureItem event will
be called prior to the DrawItem event, so that the item can be properly
sized before it is drawn to the listbox.
This is fine and dandy for items being added, when this occurs. Problem is,
that's the only time it occurs. If I want items the user clicks on to get
'big' and subsequently 'shrink' when they're no longer selected (ala the
installed programs add/remove browser in xp), it would be nice to be able to
re-measure the *existing* items before they are drawn. And in conjunction
with that, it would be nice to actually have them be redrawn when I want
them to. By default, a click of an item only triggers the redraw of THAT
item, and nothing else. Naturally if I had 1 thing selected on the list and
then clicked on another, I need to 'shrink' one and 'grow' the other. I
don't see how I can do that with the current events & methods, aside totally
rebuilding the list every time so each item is treaded as a new addition,
which would be measured and drawn correctly (a method I'll reseve as a last
resort only).
Can I get more control over the process flow of this thing to make it do
what I want?