πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.tools.owl
3 messages
3 total messages Started by Martin Truchon Thu, 12 Mar 1998 00:00
Control OWNER_DRAW
#59
Author: Martin Truchon
Date: Thu, 12 Mar 1998 00:00
20 lines
1116 bytes
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
Re: Control OWNER_DRAW
#60
Author: Pat Hennessy
Date: Thu, 12 Mar 1998 00:00
103 lines
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>&nbsp;<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>&nbsp;&nbsp; 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>&nbsp;&nbsp; staticControl->SetWindowFont(*font, true);</TT>
<BR><TT></TT>&nbsp;<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>&nbsp;</HTML>

--------------4B1A06AC46F70A8E05C0954E--
Re: Control OWNER_DRAW
#58
Author: beyler
Date: Mon, 16 Mar 1998 00:00
25 lines
1127 bytes


Martin Truchon <martin.truchon@videotron.ca> a οΏ½crit dans l'article
<350730B1.7347521A@videotron.ca>...
> 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.

Instead of using owner draw You should use SetWindowFont(HFONT,bool) it's
easier !

-- 
O.Beyler
beyler@chez.com
tel 01 42 40 83 36
France
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads