Article View: comp.os.ms-windows.programmer.tools.owl
Article #60Re: Control OWNER_DRAW
From: Pat Hennessy
Date: Thu, 12 Mar 1998 00:00
Date: Thu, 12 Mar 1998 00:00
103 lines
3336 bytes
3336 bytes
--------------4B1A06AC46F70A8E05C0954E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Martin Truchon wrote:
> Hi,
>
> I want to use a StaticText control in a dialog box (with is very
> common)
> but I want to use a Font that is different from the Font used by the
> dialog box.
>
> For example : The dialog box use the Arial 10 and I want to show a
> message using Arial 24.
>
> I tried to create an OwnerDraw control but have some trouble to find a
>
> solution.
>
> I use Borland 5.0, OWL 5.0 and design a 32 bits application.
>
> Thanks for helping me.
>
> Bernard Batt
>
> Please answer by e-mail: bbatt@hatch.ca
Here's what I do:
In the dialog's constructor create a TFont object:
TFont* font = new TFont("Courier New", 16, 8, 0, 0, FW_BOLD);
Then in SetupWindow:
staticControl->SetWindowFont(*font, true);
Yo can look up in the help for the definition of all the arguments
passed to the TFont constructor.
HTH
Pat
--------------4B1A06AC46F70A8E05C0954E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<TT>Martin Truchon wrote:</TT>
<BLOCKQUOTE TYPE=CITE><TT>Hi,</TT><TT></TT>
<P><TT>I want to use a StaticText control in a dialog box (with is very
common)</TT>
<BR><TT>but I want to use a Font that is different from the Font used by
the</TT>
<BR><TT>dialog box.</TT><TT></TT>
<P><TT>For example : The dialog box use the Arial 10 and I want to show
a</TT>
<BR><TT>message using Arial 24.</TT><TT></TT>
<P><TT>I tried to create an OwnerDraw control but have some trouble to
find a</TT>
<BR><TT>solution.</TT><TT></TT>
<P><TT>I use Borland 5.0, OWL 5.0 and design a 32 bits application.</TT><TT></TT>
<P><TT>Thanks for helping me.</TT><TT></TT>
<P><TT>Bernard Batt</TT><TT></TT>
<P><TT>Please answer by e-mail: bbatt@hatch.ca</TT></BLOCKQUOTE>
<TT></TT> <TT></TT>
<P><TT>Here's what I do:</TT><TT></TT>
<P><TT>In the dialog's constructor create a TFont object:</TT><TT></TT>
<P><TT> TFont* font = new TFont("Courier New", 16, 8, 0, 0,
FW_BOLD);</TT><TT></TT>
<P><TT>Then in SetupWindow:</TT><TT></TT>
<P><TT> staticControl->SetWindowFont(*font, true);</TT>
<BR><TT></TT> <TT></TT>
<P><TT>Yo can look up in the help for the definition of all the arguments
passed to the TFont constructor.</TT><TT></TT>
<P><TT>HTH</TT><TT></TT>
<P><TT>Pat</TT>
<BR><TT></TT> </HTML>
--------------4B1A06AC46F70A8E05C0954E--
Technical Details
Message-ID:
<3507D006.2D89E8B3@gsfc.nasa.gov>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<350730B1.7347521A@videotron.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 108ebe,dffdf539611a0b5 X-Google-Attributes: gid108ebe,public X-Google-Thread: fe201,dffdf539611a0b5 X-Google-Attributes: gidfe201,public From: Pat Hennessy <pat.hennessy@gsfc.nasa.gov> Subject: Re: Control OWNER_DRAW Date: 1998/03/12 Message-ID: <3507D006.2D89E8B3@gsfc.nasa.gov> X-Deja-AN: 333303657 References: <350730B1.7347521A@videotron.ca> To: Martin Truchon <martin.truchon@videotron.ca> X-Priority: 3 (Normal) Content-Type: multipart/alternative; boundary="------------4B1A06AC46F70A8E05C0954E" Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Mime-Version: 1.0 Reply-To: pat.hennessy@gsfc.nasa.gov Newsgroups: comp.os.ms-windows.programmer.tools.owl,borland.public.cpp.owl