home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5428 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.3 KB  |  32 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!sgiblab!sdd.hp.com!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Changing fonts in edit controls
  5. Message-ID: <1993Jan27.203046.22819@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>
  8. Date: Wed, 27 Jan 1993 20:30:46 GMT
  9. Lines: 21
  10.  
  11. In article <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de> schmitz@vier.informatik.uni-kl.de (Wolfgang Schmitz (PA Richter)) writes:
  12. >
  13. >I need to change the font used in an edit window. I
  14. >trapped the WM_CTLCOLOR message and simply mapped
  15. >a different font into the device context provided
  16. >by this message. Unfortunately this works only
  17. >half way. Although the edit window displays it's
  18. >content using the new font, there seems to be
  19. >something messed up with the position of the caret.
  20.  
  21.     For the n'th time, if you want to change the font of
  22.     a control, send it a WM_SETFONT message, with the HFONT
  23.     of your choice.  The most common requirement seems to
  24.     be to change the font to a fixed font as follows:
  25.  
  26.     SendDlgItemMessage(hdlg,id,WM_SETFONT,
  27.         (WPARAM)GetStockObject(SYSTEM_FIXED_FONT),0);
  28. -- 
  29. John A. Grant                        jagrant@emr1.emr.ca
  30. Airborne Geophysics
  31. Geological Survey of Canada, Ottawa
  32.