home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5452 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.5 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Changing fonts in edit controls
  5. Message-ID: <756@lax.lax.pe-nelson.com>
  6. Date: 28 Jan 93 19:06:58 GMT
  7. References: <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 30
  11.  
  12. In article <1993Jan27.130447.1129@posthorn.informatik.uni-kl.de>, schmitz@vier.informatik.uni-kl.de (Wolfgang Schmitz (PA Richter)) writes:
  13. |> 
  14. |> I need to change the font used in an edit window. I
  15. |> trapped the WM_CTLCOLOR message and simply mapped
  16. |> a different font into the device context provided
  17. |> by this message. Unfortunately this works only
  18. |> half way. Although the edit window displays it's
  19. |> content using the new font, there seems to be
  20. |> something messed up with the position of the caret.
  21. |> 
  22. |> Any suggestions?
  23.  
  24. A better way is to set the desired font for the control during
  25. WM_INITDIALOG processing by sending the control a WM_SETFONT
  26. message:
  27.  
  28.    .
  29.    .
  30.    .
  31.    SendDlgItemMessage(hdlg, IDEDIT, WM_SETFONT, hMyFont, 0L);
  32.    .
  33.    .
  34.    .
  35.  
  36.  
  37. ----------------------------------------------------------------------------
  38. Tom Brown               |  "She turned me into a newt...
  39. PE Nelson Systems       |                                  ... I got better"
  40. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  41. ----------------------------------------------------------------------------
  42.