ComboBox + DropDown List - context menu for list items?...

ComboBox + DropDown List - context menu for list items?...

Post by Jurij Kowa » Wed, 23 Aug 2006 11:49:07


Hi.

I wanted to add context-menu to each of the items of my DropDown List.
See example image:

http://www.yqcomputer.com/

I mean, I wanted a small popup-menu to occur when I click with RMB on
some item from the list (say, 'Collection' <- see screenshot above).
The problem is that open dropdown-list-window seems to ignore RMB clicks
(or any other mouse-actions other than selecting an item which causes
the list to close itself). Is there any possibility to 'catch' RMB
clicks in DropDown-List window?...

The other problem is that I wanted to add some 'disabled' items to the
list. They would be visible, but not selectable (the user can click on
it, but nothing happens -> the dropdown list is not closed). Is there
any way to 'check' if the item is selectable before the list would be
closed?...

With regards,
mixcherry
 
 
 

ComboBox + DropDown List - context menu for list items?...

Post by Christian » Wed, 23 Aug 2006 21:08:03

Jurij Kowal a rit :



Subclass the Combo Box, then the Combo Listbox on WM_CTLCOLORLISTBOX

 
 
 

ComboBox + DropDown List - context menu for list items?...

Post by Jurij Kowa » Fri, 25 Aug 2006 09:36:31


Thank you very much, that worked! I've (finally) been able to catch RMB
click on list item.

But there's another problem: when I display the popup-menu (using
TrackPopupMenu()), the ListBox immediately closes itself (just like I
would click somewhere outside the ListBox)...

Is it possible to somehow *block* ListBox (so it doesn't close) AND show
popup-menu at the same time? (until I choose something from popup-menu
or click somewhere outside the popup-menu)

With regards,
mixcherry