Setting text and background color in CEdit 
Author Message
 Setting text and background color in CEdit

I'm wondering simply how to set the text color and background color of a CEdit
control.  I didn't see any member functions related to that in the CEdit, so I
figured it's in a base class.  All I found was CWnd::SetFont, but I don't think
that's what I want.  

Bill



Sat, 21 Jun 2003 07:09:13 GMT  
 Setting text and background color in CEdit
You have to override OnCtlColor() to change text color and background color.
pDC->SetTextColor() would change the text color and you should return the
brush of the color that you want the background color to be.

--
Ajay Kalra [MVP - VC++]

Note: Please post all replies to newsgroup only.


I'm wondering simply how to set the text color and background color of a
CEdit
control.  I didn't see any member functions related to that in the CEdit, so
I
figured it's in a base class.  All I found was CWnd::SetFont, but I don't
think
that's what I want.

Bill



Sat, 21 Jun 2003 07:21:56 GMT  
 Setting text and background color in CEdit
Hi, Bill!

Look up TN062: Message Reflection for Windows Controls in the MSDN index. It's a long document, but
somewhere along in there they get to creating a CYellowEdit class that demonstrates how to do this
very thing.

HTH,

Jeff...
--
Please post all follow-ups to the newsgroup only.



Sat, 21 Jun 2003 07:24:41 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. set the text color and the background color of a Control Cbutton

2. Setting the Background Color of a CEdit Box marked as Read-Only

3. How do you set the background color of a CEdit control

4. Background & Text color CEdit

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

6. Colored background and text in a CEdit control

7. Setting the background color of Static Text item and window

8. setting text and background colors for a control

9. Setting background & text color

10. how to set text background color

11. Set text color for 1 line in a CEdit control (MultiLine)

12. Background Color, Text Color

 

 
Powered by phpBB® Forum Software