Questions involving the Windows Rich Edit control. This tag also applies when using wrappers around the underlying Rich Edit control (e.g. RichTextBox in WinForms, TRichEdit in VCL, RichEditBox in WinRT) when attempting to operate with the underlying control, or using features of the control.
Questions tagged [richedit]
285 questions
2
votes
1 answer
strange behavior of richedit controll, text is written horizontally like in old japanese
All this compiles ok, with no errors, but the cursor is vertical and shows on top-right corner of the window, and the text flow is like japanese top to bottom in characters, right to left in lines. The characters are invisible, but copyable. I have…

rsk82
- 28,217
- 50
- 150
- 240
2
votes
1 answer
Delphi RichEdit, get y-pixel start of an arbitrary line
I have a richedit containing lines using different fonts, styles, languages etc.
I am drawing in a gutter. I would like to start my drawing at the same y pixel position as the corresponding line.

Tom
- 3,587
- 9
- 69
- 124
2
votes
2 answers
Change highlight color of selected text in RichEdit
How do I change the color of selected text in a RichEdit control, while the text is being selected? SetSysColor() can do it, but that changes the Highlight-color globally.
Setting a CHARFORMAT2 with SCF_SELECTION, and sending a EM_SETCHARFORMAT does…
Ricardo
2
votes
1 answer
RichEdit and WM_VSCROLL message
When number of lines is not too large no problem with WM_VSCROLL message. When RichEdit has large number of lines (in my case ~130K lines with average 150 chars) it not works.
RichEdit1.Perform(WM_VSCROLL, MakeWParam(SB_THUMBPOSITION, N), 0); scroll…

Branko
- 1,384
- 1
- 16
- 35
2
votes
2 answers
Richedit style formatting changes on its own
(Someone edit the title if you can understand and define my problem better.)
The problem which I am having is with style formatting of a RichEdit "reverting" back to the default "nothing" aka [] and then back to whatever I set it to, bold or italic…

Raith
- 851
- 4
- 12
- 25
1
vote
1 answer
How to add a RTF-string to RichEdit?
I am working with a RichEdit and I am adding lines to it, containing various colors. Now I use this…

Martin Melka
- 7,177
- 16
- 79
- 138
1
vote
1 answer
Dialog-based Win32 API program will not display window when a Richedit control is used
I've written a dialog-based Windows application that contains two edit controls and two button controls. ResEdit 1.5.9-x64 was used to create the dialog window and place/position the controls. The program compiles and runs perfectly and everything…
user1114264
1
vote
1 answer
Change character formatting of a range
I'm trying to realize a code to add the syntax-highlighting to the richedit of winapi, so I search ranges of text that I must colorize, but if I select the range with the EM_EXSETSEL message to format with the EM_SETCHARFORMAT message, it's very…

Triton
- 93
- 6
1
vote
1 answer
dropdown-list of custom combobox in Delphi is closing right after comming up
I was looking for an easy way to use RichtText in a default combobox, but found nothing.
So I wrote this little Delphi(7) component, that is working so far.
How is works:
I'm calling "init" to replace the "Edit"-window inside a default combobox with…

Pete Hoover
- 11
- 1
- 2
1
vote
1 answer
How to set a font in rich edit 4?
I want to change the font of the richedit control in my win32 program to Consolas. When i try to do the following:
CHARFORMAT2 cformat;
cformat.dwMask = CFM_FACE;
cformat.cbSize = sizeof(cformat);
cformat.szFaceName = "Consolas";
On the last line…

devjeetroy
- 1,855
- 6
- 26
- 43
1
vote
1 answer
Rihedit text margin
How to set the richedit text's top/left margins so that it should display a text lower/farther from its top/left border by the specified distances? I write in c++.
Thanks

Vitaly
- 597
- 1
- 5
- 12
1
vote
1 answer
How can I switch to Rich Edit 4.1 (or higher) in Delphi 11.1.5
I have character encoding problems with the base TRichEdit component in Delphi 11.1.5. It does not handle in its output RTF the situation if I switch the keyboard language and type hun/en special characters (ő/ű/²). It just stores one codepage at…

SOLID Developper
- 672
- 4
- 12
1
vote
2 answers
RichEdit - WM_GETTEXTLENGTH and EM_SETSEL consider different new lines characters
RichEdit has a strange behavior. The WM_GETTEXTLENGTH message considers the new line characters as two characters \r\n, while the EM_SETSEL and EM_EXSETSEL messages consider them as one character \n.
This creates confusion and lot of bad things, for…

Alex Veres
- 29
- 2
1
vote
1 answer
How do you change the color of specific characters in a rich edit in Delphi?
Possible Duplicate:
How can I change the color of certain characters in a TRichEdit?
I have to do a project in which I have to either change the color of specific individual characters in a line in a rich edit to random colors or change the color…

Paul
- 11
- 2
1
vote
1 answer
How to disable "text-selection" cursor in RichEdit
I want to show standard "pointer" cursor instead of "text-selection cursor" (shown in the picture below) in RichEdit:
The only way I see now is to intercept WM_SETCURSOR message in my window, determine wether cursor is inside RichEdit control, and…

qloq
- 689
- 1
- 5
- 15