470,619 Members | 1,784 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

Re-measuring existing items in an ownerDrawVariable Listbox

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?
Nov 20 '05 #1
0 1355

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Nel | last post: by
4 posts views Thread by Craig Bailey | last post: by
1 post views Thread by Chris | last post: by
11 posts views Thread by James | last post: by
4 posts views Thread by Alan Walkington | last post: by
1 post views Thread by John Ryan | last post: by
10 posts views Thread by James | last post: by
8 posts views Thread by Beowulf | last post: by
1 post views Thread by joost | last post: by
3 posts views Thread by presspley | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.