🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2407

Re: Changing fonts in edit controls

#2407
From: Tom W. Brown
Date: Thu, 28 Jan 1993 19:06
30 lines
1555 bytes
In article <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>, schmitz@vier.informatik.uni-kl.de (Wolfgang Schmitz (PA Richter)) writes:
|> 
|> I need to change the font used in an edit window. I
|> trapped the WM_CTLCOLOR message and simply mapped
|> a different font into the device context provided
|> by this message. Unfortunately this works only
|> half way. Although the edit window displays it's
|> content using the new font, there seems to be
|> something messed up with the position of the caret.
|> 
|> Any suggestions?

A better way is to set the desired font for the control during
WM_INITDIALOG processing by sending the control a WM_SETFONT
message:

   .
   .
   .
   SendDlgItemMessage(hdlg, IDEDIT, WM_SETFONT, hMyFont, 0L);
   .
   .
   .


----------------------------------------------------------------------------
Tom Brown               |  "She turned me into a newt...
PE Nelson Systems       |                                  ... I got better"
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
Technical Details
Message-ID: <756@lax.lax.pe-nelson.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
References: <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Changing fonts in edit controls
Message-ID: <756@lax.lax.pe-nelson.com>
Date: 28 Jan 93 19:06:58 GMT
References: <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>
Sender: news@lax.pe-nelson.com
Organization: PE-Nelson
Lines: 30