[ Home | Contents | Search | Next | Previous | Up ]
Date: 11/29/99
Time: 11:53:53 PM
Q. Could someone tell me how to use OWL to change the font (eg size,
type,colour) of the text used in buttons, or in window titles etc. And if someone
could tell me how to get the text in a button to span two or more lines, that would be
useful too!
A. To set/change the font for a particular window, you can call
TWindow ::SetWindowFont (). If you do this, bear in mind that 1) the TFont you feed
SetWindowFont () must live for as long as it is being used (so you might want to include a
TFont * member in your window, new it in the constructor,
and delete it in the destructor), and that 2) you cannot call SetWindowFont() in your
window's constructor; the Windows interface element must be
extant for the call to work, so you want to call it in SetupWindow () or later.
You can get multiple lines of text by specifying the BS_MULTILINE style for
your button.
--
John Gaffney
jbgaffney@hotmail.com