Change fonts in a property pages of property sheet 
Author Message
 Change fonts in a property pages of property sheet

Hello people there,

        I had made a property sheet with two pages in it, later
        I changed the font of one page, after compilation and runming of the
new program, the font remained unchanged. Dont know how to solve it

                        Many thanks in advance

                                                        Bill W



Fri, 05 Nov 1999 03:00:00 GMT  
 Change fonts in a property pages of property sheet

Bill,

Don't forget to make the font a member variable.  I was trying to do
the same thing, use a number of different fonts in a property sheet.
Use Scott's suggestion with a member variable and you should be
all set.

Don Hanson

Quote:

> Bill,

> Dialogs and their child control windows are scaled according to the
> dialog
> font.  If you have several property pages in a property sheet, they
> all
> need to use the same font (I'm pretty sure that the pages inherit the
> font
> that the property sheet uses).  If each page used a different font,
> they'd
> need to be different sizes...

> You can, however, change the font used by individual controls in a
> property
> page at runtime.  To do this, you'd create a font (usually in the
> OnInitDialog member function of the page), and call the SetFont method
> of
> the control window.

> There are various ways to create a font -- the easiest is to take the
> existing dialog font, and modify some aspect of it (make a BOLD
> version,
> for instance):

>   BOOL CMyPropPage::OnInitDialog()
>   {
>     LOGFONT lf;

>     // Fill the LOGFONT struct (lf) with information about
>     // the dialog font
>     VERIFY( GetFont()->GetObject(sizeof(lf), (LPSTR)&lf) );

>     // We're going to make a BOLD version...
>     lf.lfWeight = FW_BOLD;

>     // Create the bold font (m_fontBold is a CFont member
>     // variable of this class, defined in the header file)
>     VERIFY( m_fontBold.CreateFontIndirect(&lf) );

>     // Now, set one or more controls to use this bold font...
>     GetDlgItem(IDC_EDIT1)->SetFont(&m_fontBold);
>     GetDlgItem(IDC_EDIT2)->SetFont(&m_fontBold);
>       .
>       .
>       .
>   }

> --
> Scott Smith


> > Hello people there,

> >       I had made a property sheet with two pages in it, later
> >       I changed the font of one page, after compilation and runming
> of the
> > new program, the font remained unchanged. Dont know how to solve it

> >                       Many thanks in advance

> >                                                       Bill W



Sat, 06 Nov 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Property Sheet and Property pages in ATL

2. How to disable property page on property sheet.

3. Property sheet in a property page

4. Property pages disappearing from property sheet on selection

5. questions regarding property sheet and property page

6. Problem with same property page in multiple property sheets

7. Sizing Property Sheets/Property Pages

8. Problems with property sheets and property pages

9. Property Sheet and Property Pages

10. Property Sheet on Property Page?

11. resizable property sheet and property page

12. Q: Set Tab Window Text in Property Page/Property Sheet

 

 
Powered by phpBB® Forum Software