
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