MFC - problem with RichEdit and ES_NOHIDESEL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dorito
    New Member
    • Jun 2009
    • 18

    #1

    MFC - problem with RichEdit and ES_NOHIDESEL

    I have two classes derived from CRichEditView - on one, when I bring up the context menu with a r-click or a ctrl-F, I can search for a string in my text and it will highlight the text while the search dialog still has focus ... exactly what is expected if ES_NOHIDESEL is specified in the style at creation, or if I do


    Code:
    MyCtrl->SetOptions (ECOOP_SET, ECO_NOHIDESEL );
    However, when I have the identical creation code for the other CRichEditView class, and even though, when I check the options right before the Popup Menu is called, the NOHIDESEL flag is indeed set (0x100) - it will do a search, but will only show the highlighted text when focus is returned to the frame-view ... which is completely irritating to anyone doing a search:

    Code:
    UINT uOptions = MyCtrl->GetOptions();  // NOHIDESEL is set
    MyApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);  // does not highlight text like it should
    These Rich Edits have sufficiently different functionality that I don't want to simply meld one into the other ... but there is seemingly no difference in their initialization.

    Also interesting is that whether I include ES_NOHIDESEL in the window style seems to have no relation to the presence of the ECO_NOHIDESEL option ... indeed it seems to be set by default even though the documentation says it is not default behavior.

    Something is fishy! .
Working...