franji1
franji1

Reputation: 3156

MFC: How to determine the currently HIGHLIGHTED item in a CComboBox list (NOT selected item)

This is similar BUT NOT THE SAME as C# questions, but as everyone knows, MFC is not .NET. MFC objects do NOT have the same runtime properties as .NET objects.

Upvotes: 0

Views: 797

Answers (2)

franji1
franji1

Reputation: 3156

By using the Owner Draw mechanism (even though it's a simple text list), the callback has flags/attributes that shows which entry needs to be "highlighted", which we post a notification as to which item is currently "highlighted".

The complexity was MUCH less than trying to implement basic ComboBox functionality in a ComboBoxEx control (e.g. basic ComboBox styles do NOT apply to ComboBoxEx - don't ask).

Upvotes: 1

Javier De Pedro
Javier De Pedro

Reputation: 2239

I don't know if it would be of much help but....every time the highlighted item changes you receive a CB_GETCOMBOBOXINFO message.

I don't thik the information you receive with this message is going to help but if you really need to know the highlighted item maybe you could calculate it based on the mouse position and the height of every item. A bit tricky but possible.

I hope it helps.

Upvotes: 0

Related Questions