CEdit for Colored font??? 
Author Message
 CEdit for Colored font???

i am using updateData(FALSE) to display the values in the
edit boxes.
I want the text displayed of Bold type and font color to
be different.
how do i achieve this.
How do i make the text to blink in my program based on
some critical conditions.


Mon, 20 Jun 2005 13:59:47 GMT  
 CEdit for Colored font???

Quote:
>I want the text displayed of Bold type and font color to
>be different.
>how do i achieve this.

Have a look at Knowledge Base article 85518 "Correct Use of the
SetFont() Function in MFC". To change the colour, handle the
WM_CTLCOLOR message.

Quote:
>How do i make the text to blink in my program based on
>some critical conditions.

You'd have to arrange to redraw the text in different colours on a
timer.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 20 Jun 2005 15:20:54 GMT  
 CEdit for Colored font???
Well, first, I'd avoid UpdateData entirely. See my essay to this effect on my MVP Tips
site. To change the color, subclass CEdit, add an =WM_CTLCOLOR handler, and change the
background color and text color. You will also need to return a brush of the correct
background color.

in the class add a protected variable:
        CBrush br;
in the constructor
        br.CreateSolidBrush(RGB(rb,gb,bb));

in the OnCtlColor handler:

HBRUSH CMyEdit::CtlColor(CDC * pDC, UINT id)
   {
     LOGBRUSH lb;
     br.GetLogBrush(&lb);
     pDC->SetBkColor(lb.lbColor);
     pDC->SetTextColor(RGB(rt,gt,bt));
     return (HBRUSH)br;
    }
                                joe

Quote:

>i am using updateData(FALSE) to display the values in the
>edit boxes.
>I want the text displayed of Bold type and font color to
>be different.
>how do i achieve this.
>How do i make the text to blink in my program based on
>some critical conditions.

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Mon, 20 Jun 2005 21:43:25 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to set the color of font for a CEdit Control

2. CEdit controls and changing the font color

3. CEdit font & color

4. Change font and color in CEdit end/or CStatic

5. CEdit Font Color / Style

6. Set CEdit font to COleControl Font

7. CEditView Background Color & Font Color :: MFC

8. FONT Changing in a CEdit Window

9. Changing CEdit Font type

10. Select a font for CEdit

11. Changing Font in CEdit control

12. Setting Fonts on CEdit - URGENT, please help!!!

 

 
Powered by phpBB® Forum Software