Something About Property Sheets?

How can I change the fonts of the labels of controls on the property sheet?
LVL 2
sun307Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bhatCommented:
What do U mean by controls.

Do U mean Tabs ?????
Or OK,CANCEL,APPLY buttons
0
bhatCommented:
Hi

The OK, CANCEL, APPLY  button fonts can be changed by doing the following :

In PropertySheet class
..h declare
CFONT *pFont;

in .cpp
in the constructor add

pFont = new CFont ;
pFont->CreateFont( -9,0, 0, 0, FW_EXTRABOLD, 1, 0, 0,  
         ANSI_CHARSET,OUT_STROKE_PRECIS ,                   CLIP_STROKE_PRECIS,
            DRAFT_QUALITY,34, "MS Sans Serif");


Now in OnInitDialog()
 BOOL CSheet::OnInitDialog()
{
  BOOL bResult = CPropertySheet::OnInitDialog();
CWnd *pWnd = GetDlgItem(IDOK);
      if (pWnd)
       pWnd->SetFont(pFont);

pWnd = GetDlgItem(IDCANCEL);
if (pWnd)
  pWnd->SetFont(pFont);
pWnd = GetDlgItem(ID_APPLY_NOW);
if (pWnd)
    pWnd->SetFont(pFont);

}

This will set the font for the controls in property sheet ie. OK,CANCEL,APPLY buttons.

Now if U have a button in a property page

Now Do the same thing ie. declare a font ,create it in Page class
and in the initdialog of the page class

BOOL CPage1::OnInitDialog()
{
      CPropertyPage::OnInitDialog();

       CWnd *pWnd = GetDlgItem(IDOK);
      if (pWnd)
       pWnd->SetFont(pFont1);

}
where pFont1 is declared .in .h
and font is created in the constructor.


Hope this helps


0
sun307Author Commented:
No, by controls i never meant the tabs bur all the other controls, i.e. check box, radio button, text box etc. on the property sheet .
And i want to change the fonts of all the controls on the property sheet in one go not individually.
0
bhatCommented:
Hi Check this

http://support.microsoft.com/support/kb/articles/q142/1/70.asp

This sets the the font for property sheets & property pages.

Check this out
Hope this helps U.

Bhat
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.