[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Something About Property Sheets?

How can I change the fonts of the labels of controls on the property sheet?
0
sun307
Asked:
sun307
  • 3
1 Solution
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now