Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing text font/color/size/background in RichEdit TextBox
#1
Hi Gintaras,
I have some text that I fill a richedit text box with in a dialog. I know how to change the text size/font/background for the entire contents of the text box. However, is it possible to do it for just a selected string within the box?
e.g.

"The word RED should be red but all the rest of the text should be normal"

Thanks!!!,

Stuart
#2
yah just make the code seperate
whatever words you want red make red
the rest dont add it... like 2 lines
#3
thanks for responding. I am not sure I understand your error.
The text in the richedit field is variable. I don't know what it is ahead of time.
The selected text within that is also variable - they represent selected text in a separate applications text field
i.e. I take the whole contents of the other app's text field (several paragraphs) and whatever the user had selected within that I want to have in different font/color/background.

If you could clarify your answer or even give an example, that would be great.
S
#4
EM_SETCHARFORMAT

several examples should be here
documented in MSDN library


Forum Jump:


Users browsing this thread: 1 Guest(s)