|
-
March 28th, 1999, 09:12 PM
#1
Re: Font on Button
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|