Change background color of selected text 
Author Message
 Change background color of selected text


I've encountered a problem to change the background color of selected text
in Richtext edit. The default color of selected text is black color in
Richtext version 1.0 and blue color in version 2.0.
If I call ::SetSysColors API to change the selected text background color
then all the windows controls will get effective. Is there any way to make
it only works in my application ?



Wed, 24 Mar 2004 13:43:41 GMT  
 Change background color of selected text
Hi Rene,

You can use SetSelectionCharFormat to change the selected text:


cf.dwMask = CFM_COLOR;
cf.dwEffects =0;


I hope this helps. If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Copy Right, 2001 Microsoft Corporation.
All rights reserved.

Felix Wu

Sat, 27 Mar 2004 22:08:43 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Change text color and background color in CEditView

2. Change a part of Background color or a part of text color from CListCtrl

3. changing text color of selected rows in clistctrl

4. How I can change selected text color?

5. Changing the color of the selected text in a CEdit control

6. changing background color of the text

7. How to change background and text color of CPropertySheet

8. Changing Background Color of CEdit - Problem With Double Clicking On Texts

9. Changing the background color of a static text control

10. Developer studio addin - SetWindowsHookEx, changing the text background color

11. Change color background of astatic text

12. Changing Text and Background Color on Pushbuttons


Powered by phpBB® Forum Software