Questions tagged [cricheditctrl]
45 questions
4
votes
2 answers
CRichEditCtrl selects all text when it gets focus
I had a dialog with a menu and a CTabCtrl. The CTabCtrl had one tab, which contained a CDialog. In turn, that contained a few static texts and a CRichEditCtrl. There was no particular issue with the window gaining and losing focus.
I since added…

Swiss Frank
- 1,985
- 15
- 33
3
votes
1 answer
How to use richedit control _RICHEDIT_VER over 2.1 in MFC
I'd like to use Rich edit control's underline color in MFC
but, in afxwin.h, _RICHEDIT_VER define 0x210.
like this,
#define _RICHEDIT_VER 0x0210
I'm loading 'msftedit.dll'(8.1 Version) and Windows10 SDK (10.0.16299.0)
but, bUnderlineColor is coded…

JaeHyeok Kim
- 103
- 5
3
votes
1 answer
How to stop a MFC/win32 control re-painting
I have a CRichEditCtrl, and an algorithm works on its contents in-place, iterating through the contents and making changes. This seems to cause it to re-paaint every time, which causes flickering and a noticeable time to complete the operation,…

Mr. Boy
- 60,845
- 93
- 320
- 589
3
votes
3 answers
CRichEditCtrl prevent auto scroll on SetSel
I have a CMyRichEditCtrl class inheriting from CRichEditCtrl. When I call SetSel, it automatically scrolls the contents of the CRichEditCtrl so that the caret is visible. I would like to avoid this behavior.
What is bugging me it that this behavior…

MasterMind
- 379
- 2
- 17
2
votes
1 answer
RichEditCtrl and its text content
I copy all formatted rich edit text into clipboard as
m_edit.setsel(0,-1);
m_edit.copy();
But when I call GetClipboardData,
I obtain text without format.
Someone could explain to me something about this ?

Bigbooboy
- 21
- 1
2
votes
1 answer
MFC: How do you have CRichEditView print the selection?
I can enable the print dialog to show the option to print the selection by pInfo->m_pPD->m_pd.Flags &= ~PD_NOSELECTION; in OnPreparePrinting() just before the DoPreparePrinting() function but if you select the option the object is still printing…

user3161924
- 1,849
- 18
- 33
2
votes
0 answers
CRichEditCtrl 50W font issues
I'm dynamically (in runtime) creating a CRichEditCtrl control and when I set the text to it, the font is different from the other controls (e.g. CStatic - see the pictures) in the dialog (I didn't use any formatting for the rich edit control). The…

mrdecompilator
- 155
- 1
- 8
2
votes
1 answer
Msftedit seems to be inconsistant handling paragaph marker (\par) at end of file
I have implemented the use of cricheditctrl to concatinate rtf text and I ran into an issue with \par at the end of the file. Wordpad uses the same generator and does the same thing. (Msftedit 5.41.21.2510).
If I, where wtrf is a…

lakeweb
- 1,859
- 2
- 16
- 21
2
votes
2 answers
How to display Red Squiggly Lines in CRichEditCtrl in MFC
I am working on implementing spellchecker in an MFC application. What I want to do is display red lines under incorrectly spelled words.
I found one example where it is done but it works only for a simple edit box because it can simply use the edit…

Sachin
- 127
- 9
2
votes
1 answer
CRichEditCtrl won't let edits put it above 160560 bytes?
At about 1600 lines, about 100 chars per line, typing more neither shows up in the buffer nor calls the
ON_CONTROL( EN_CHANGE, IDC_PATCH, OnUpdate )
callback.
If I paste into the buffer, only enough characters to come up to this limit are being…

Swiss Frank
- 1,985
- 15
- 33
2
votes
2 answers
Spurious '\r' added by CRichEditCtrl::GetLine() when called on single-character lines?
I tried using CRichEditCtrl::GetLine() to retrieve the text of a given line of a rich-edit control in an MFC application built with VS2015 in Unicode mode, and running on Windows 10.
I wrote this helper function:
CString GetLine(CRichEditCtrl&…

Mr.C64
- 41,637
- 14
- 86
- 162
2
votes
1 answer
How could I change the highlight color in a CRichEditCtrl?
I've tried to catch the EN_SelChange event, but it never triggers although I have added
rich->SetEventMask(rich->GetEventMask() | ENM_CHANGE | ENM_SELCHANGE);
in OnInitDialog fxn.
So I tried to add the following code in my OnEraseBkgnd…

Bill Sun
- 51
- 5
2
votes
3 answers
CRichEditCtrl appending colored text?
I have a CRichEditCtrl in an MFC project, which I use as a report log.
Depending on the given situation, I need to append different colored text to the control (ie. a blue line for standard notifications, a red line for errors, etc).
I've come…

RectangleEquals
- 1,825
- 2
- 25
- 44
2
votes
1 answer
What makes ::AfxInitRichEdit2 fail and how do I fix it?
I am building an existing MFC application with Visual Studio 2012. The application uses "RichEdit20A" controls and custom controls which inherit CRichEditCtrl.
During InitInstance() the application calls ::AfxInitRichEdit2(), which calls…

Håvard S
- 23,244
- 8
- 61
- 72
1
vote
1 answer
Printing page breaks from an MFC RichEdit control
I've created a Rich Edit control (1.0) from MFC as below:
m_hRichEditWnd = ::CreateWindow(_T("RichEdit"), csWindowName, ES_MULTILINE|ES_READONLY, 0, 0, 200, 200, NULL, 0, 0, 0);
I've read text into that control from a file. The file is a multipage…

Dan G
- 836
- 11
- 31