I'm using mfc in C++ app. I had CEdit controls and changed them for CRichEditCtrl. App is graph editor with internal code in nodes where TextBox is holding the code in dialog in separate window from wnd with graph. If node is clicked, that wnd and dialog is showed (different nodes have different wnds and are hidden when inactive)
My problem is that if I have some longer text in that text box whole area of the text box is grayed. Text is still there, caret can be set by mouse click but nothing is visible until I do something special. For example: by selecting text by mouse click&drag, lines containing the text are once again white and text visible. Other possibility is scrolling, lines that get out of scope will be fine.
I managed to fix this by calling Invalidate on this control but:
- I don't really understand why this is happening
- I have implemented search and selecting found words in the text but this graying still occurs instead of selecting first text. When selecting second word in that node and control, whole text box is again clean and working as it should but when going out and in with the search result situation repeats.
On the picture, you can see the rich text box between red fields (BG of dialog holding the controls). On the left the control is nice white control with text. On the right is the same control after search but grayed and after clicking into it and selecting some text with two "unrevealed" pieces of code.
Any advice why this is happening and/or how can I get rid of this behavior?
Strange thing is that when I experimented with some solutions Calling Invalidate() made it behaving well for some cases but calling UpdateWindow() after invalidate messed thing up again.
CEdit
do you have the same problems? Can you duplicate what order of events you need to do to get the display issue, or events that don't have the display issue? – uespCONTROL "",IDC_STATEEDIT,"RichEdit20A",ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,3,52,133,218
– Marcel Fyrgon Marciš