Click to See Complete Forum and Search --> : Re: Font on Button


Ramon Saenz-Badillos
March 28th, 1999, 08:12 PM
To change the font and color of controls in a dialog box:

For each font that you need define a CFont variable in your dialog

class CYourDlg : public Cialog {

//...

protected:

CFont m_Font1, mFont2;

//... }

in OnInitDialog create the fonts and use CWnd::SetFont() to apply them to the contols.

BOOL CYourDlg::OnInitDialog() {

CDialog::OnInitDialog();

CClientDC dc (this);//for GetDeviceCaps

//create your font LOGFONT lf and initialize it

//once its ready create the font with

m_font1.CreateFontIndirect(&lf);

//set the control font

GetDlgItem(/*your control name*/)->SetFont(&m_font1);

etc.



good luck