home *** CD-ROM | disk | FTP | other *** search
- Path: 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
-
- 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
- ----------------------------------------------------------------------------
-