Deriving Combobox items indexes

G

Guest

To anyone who might be able to help.

I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item. I know it can be done with a listbox. Basically looking for
the LB_ITEMFROMPOINT equivalent for Comboboxes. Does anyone have any idea
how to accomplish this with a combobox? Please help.
 
C

Cor Ligthert [MVP]

Easton,

Any reason that you want to do this, it sound for me forever stupid that
people want to confrontate users with non standard behaviour. Something from
the 80's in the previous century.

Cor
 
P

Phill W.

Easton said:
I'm trying to derive the index of any random item in a populated combobox
dropdownlist when the mousepointer is over the item. Seems to me it should
be possible since the item "highlights" when the mouse passes over the
different items listed, but the end user hasn't yet "clicked/selected" any
specific item.

If you create a Control derived from ComboBox, make it OwnerDrawn and
override the DrawItem method, you should be able to pick out the
currently "hovered" item based on each item's style. (IIRC, the item's
index is passed as part of the Event Arguments).

Not something to take on lightly, but it you /really want to...

Regards,
Phill W.
 
G

Guest

Yes, my application would use the index to derive a preview of information to
help the end user make the best possible choice from the combobox.
 
G

Guest

Thank you Phill, I've been headed in that direction as well. Would you
happend to know what event I should be watching?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top