1

I need to develop a search module for an mfc ribbon application using C++. I have used auto complete feature in C#.NET but never worked on any mfc ribbon application. I want auto complete search with an icon image as prefix of each suggestion, just like Facebook search. I have also consulted this article, but that uses CComboBox, I need to use CMFCRibbonCombobox in my program because I tried with CCombobox but that was causing problems. Any help will be appreciated.

Itban Saeed
  • 1,660
  • 5
  • 25
  • 38

1 Answers1

2

you need to create your own CMFCRibbonComboBox derived class, that will be pretty much a copy of the CMFCRibbonFontCombBox without the fonts.

to check how you draw the images you can check the CMFCRibbonFontComboBox::OnDrawDropListItem implementation.
Then I think that you will have to dynamicaly add it to the ribbon.

Robson
  • 916
  • 5
  • 22
  • This gets to be a real pain if you're using the ribbon designer as your code won't actually have any CMFCRibbonComboBox items that can be replaced with the derived class. The approach I took was to rewrite one of the base classes as per the answer linked below. Blatant hack, but works better. http://stackoverflow.com/questions/39728045/how-to-get-notification-for-keydown-for-cmfcribboncombobox – SmacL Oct 16 '16 at 11:33