🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Changing fonts in edit controls

#2388
From: John Grant
Date: Wed, 27 Jan 1993 20:30
21 lines
1381 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.

	For the n'th time, if you want to change the font of
	a control, send it a WM_SETFONT message, with the HFONT
	of your choice.  The most common requirement seems to
	be to change the font to a fixed font as follows:

	SendDlgItemMessage(hdlg,id,WM_SETFONT,
		(WPARAM)GetStockObject(SYSTEM_FIXED_FONT),0);
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Technical Details
Message-ID: <1993Jan27.203046.22819@emr1.emr.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!amdahl!rtech!sgiblab!sdd.hp.com!cs.utexas.edu!torn!nott!emr1!jagrant
References: <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!amdahl!rtech!sgiblab!sdd.hp.com!cs.utexas.edu!torn!nott!emr1!jagrant
From: jagrant@emr1.emr.ca (John Grant)
Subject: Re: Changing fonts in edit controls
Message-ID: <1993Jan27.203046.22819@emr1.emr.ca>
Organization: Energy, Mines, and Resources, Ottawa
References: <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>
Date: Wed, 27 Jan 1993 20:30:46 GMT
Lines: 21