Changing font in a CStatusBar 
Author Message
 Changing font in a CStatusBar

Hi,

    Using VC 5 SP2 EE on Win95/NT4.   Am creating dialogs/form views that
have a status bar dynamically attached to them.  Would like the status bar
to inherit the font of the dialog/form.  It is a simple CStatusBar having a
single pane att.

thanks in advance,
Bill



Mon, 31 Jul 2000 03:00:00 GMT  
 Changing font in a CStatusBar

Bill,

You have to create a font and do a SetFont() for the statusbar window.
Otherwise you get the default "status bar" font.

Tom

Quote:

> Hi,

>     Using VC 5 SP2 EE on Win95/NT4.   Am creating dialogs/form views that
> have a status bar dynamically attached to them.  Would like the status bar
> to inherit the font of the dialog/form.  It is a simple CStatusBar having a
> single pane att.

> thanks in advance,
> Bill



Mon, 31 Jul 2000 03:00:00 GMT  
 Changing font in a CStatusBar

:Bill,
:
:You have to create a font and do a SetFont() for the statusbar window.
:Otherwise you get the default "status bar" font.
:
:Tom
:
:
:> Hi,
:>
:>     Using VC 5 SP2 EE on Win95/NT4.   Am creating dialogs/form views that
:> have a status bar dynamically attached to them.  Would like the status
bar
:> to inherit the font of the dialog/form.  It is a simple CStatusBar having
a
:> single pane att.

Thanks for the starter tip.  When is it best for this to happen?

I could derive a class from CStatusBar[Ctrl] and override OnCreate, adding a
member variable for a new font pointer that gets selected in then and
selected out & destructed in OnDestroy.  Or does the status bar control
clean up after itself so I just need to select it into the device context of
the status bar window and not worry about that (or the previous font it
had)? If I dont do this do I run the risk of leaking GDI resources? Will
overriding it in OnCreate avoid having to write code to resize the window?
Is that code (resizing because of a font change) a simple API call?

If I am considering colorizing the text is an owner-draw status bar the only
way to accomplish this, or just the best way?

Sorry I wasnt clearer earlier....any examples greatly appreciated.

Thanks,
Bill



Tue, 01 Aug 2000 03:00:00 GMT  
 Changing font in a CStatusBar

Bill,
    There is an owner-drawn CStatusBar-derived class for free over on
www.codeguru.com - click on the Status Bar link and then you can download
the 'Enhanced status bar class' project.  This class will handle an
individual font for each pane, separate background colors, separate
foreground colors, tiled bitmap backgrounds, horizontally and vertically
scrolling text.  I tried to make it as close as possible to a drop-in for
CStatusBar, but there's a little extra initialization stuff you have to do.
All the instructions are on codeguru.com.

--
Spam-resistant return address...
Remove .Spleen to reply
Doug

Quote:

>Thanks for the starter tip.  When is it best for this to happen?

>I could derive a class from CStatusBar[Ctrl] and override OnCreate, adding
a
>member variable for a new font pointer that gets selected in then and
>selected out & destructed in OnDestroy.  Or does the status bar control
>clean up after itself so I just need to select it into the device context
of
>the status bar window and not worry about that (or the previous font it
>had)? If I dont do this do I run the risk of leaking GDI resources? Will
>overriding it in OnCreate avoid having to write code to resize the window?
>Is that code (resizing because of a font change) a simple API call?

>If I am considering colorizing the text is an owner-draw status bar the
only
>way to accomplish this, or just the best way?

>Sorry I wasnt clearer earlier....any examples greatly appreciated.

>Thanks,
>Bill



Tue, 01 Aug 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Changing font in leftmost (message) pane of CStatusBar

2. Changing font and font size on a printout

3. Changing font to Windows font

4. Changing the font and font size on a printout

5. Changing font & font size for CListView windows

6. Change the default font of CRichEditCtrl to a fixed pitch font

7. Treeview - treenode - font change - problem or by design?

8. Changing Font of Nodes in a Treeview

9. Changing font of textbox

10. Changing font color in a textBox control

11. Changing Console Font Size from within app in Win95 (MSVC)

12. How change font in Text(03h) mode ?

 

 
Powered by phpBB® Forum Software