CFontDialog sets initial font color to black 
Author Message
 CFontDialog sets initial font color to black

Hi,

I am trying to use CFontDialog with the CF_EFFECTS flag set and also setting
CFontDialog::m_cf.rgbColors with a COLORREF of that which is not listed in
the Effects->Color dropdown inside the dialog itself.

Doing so causes CFontDialog to default to black when CFontDialog::DoModal is
called.

I want it to set it to my custom color.

Anyway know if there is a way to do this?

Thanks,

David



Tue, 17 Feb 2004 12:17:21 GMT  
 CFontDialog sets initial font color to black
Hi

I have tested with the following code. It works fine.

void CAboutDlg::OnButton1()
{
    CFont               font;  
        CFontDialog     fontDialog;    
        COLORREF inicolor;

        inicolor = RGB(255,0,0);
        fontDialog.m_cf.Flags |= CF_EFFECTS;    
        fontDialog.m_cf.rgbColors = inicolor;
        fontDialog.DoModal();    

Quote:
}

Regards,
Billy


Tue, 17 Feb 2004 13:58:46 GMT  
 CFontDialog sets initial font color to black
Hi Billy,

Yes this color works just fine for me too...

That is because it is a color which is listed in the Color dropdown inside
the CFontDialog.

Try RGB(255, 245, 35) as an example and see what happens... (it should be a
shade of yellow)

- David


Quote:
> Hi

> I have tested with the following code. It works fine.

> void CAboutDlg::OnButton1()
> {
>     CFont font;
> CFontDialog fontDialog;
> COLORREF inicolor;

> inicolor = RGB(255,0,0);
> fontDialog.m_cf.Flags |= CF_EFFECTS;
> fontDialog.m_cf.rgbColors = inicolor;
> fontDialog.DoModal();
> }

> Regards,
> Billy



Tue, 17 Feb 2004 14:28:44 GMT  
 CFontDialog sets initial font color to black
Yes, the color should be in the list.


Sat, 21 Feb 2004 20:45:46 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Setting font size in CFontDialog

2. Set font size in CFontDialog

3. Set font size in CFontDialog

4. Disabled CEdit - > set color to Black

5. create view with background color set to black

6. color setting and font settings

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

8. Setting ListBox text font and color

9. Font questions - how to set color

10. set static font color in PropertyPage

11. CFontDialog shows 60 point font that was initiaized to 12 point Times Roman

12. Specify fonts in CFontDialog

 

 
Powered by phpBB® Forum Software