c++autocompletemfcribbonautocompletebox

How to use an autocomplete edit control in an MFC Ribbon Application


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.


Solution

  • 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.