Board index » delphi » different font for titlebar, hints, menus etc.

different font for titlebar, hints, menus etc.

Hi,

I would like to use a different font for the titlebars, hints and menus
is this possible and how ?

Greetings

Rob Segerink

 

Re:different font for titlebar, hints, menus etc.


Quote
> I would like to use a different font for the titlebars, hints and menus
> is this possible and how ?

Rob,

Hints: derive a new class from THintWindow, override its constructor and
set the font you want. Assign this class to the HintWindowClass variable
in the forms unit to make all controls use it.

Menus: you have to make the menus owner-drawn to be able to override the
default menu font (which is a system setting). See TMenu.OwnerDraw and
the TMenuitem.onDrawItem event.

Titlebar: way more difficult, unfortunately. The title font is also a
system setting and to override it you basically need to take over the
painting of the caption. This requires handling several of the WM_NC*
messages, e.g. WM_NCPAINT, WM_NCACTIVATE and also, i think, WM_SETTEXT.
You can get a device context usable for painting on the title bar with
GetWindowDC.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads