Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!uunet!microsoft!kensy From: kensy@microsoft.UUCP (Ken SYKES) Newsgroups: comp.windows.ms Subject: Re: Setting ListBox font Message-ID: <56928@microsoft.UUCP> Date: 27 Aug 90 06:30:07 GMT References: <1355@msa3b.UUCP> Reply-To: kensy@microsoft.UUCP (Ken SYKES) Organization: Microsoft Corp., Redmond WA Lines: 26 In article <1355@msa3b.UUCP> kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes: >How does one set the font for a listbox? The only thing I can find >about changing fonts in TFM is for TextOut. i.e. > SelectObject (hDC, hFont); > TextOut (hDC, ...); > >The only way I can see to use this information would be with an owner-draw >listbox (and that LOOKS like a lot of work to me). Yes, you will have to do an owner-draw listbox. It is a little more work but not terribly bad (esp. since you only want to change the font) The interface to the listbox still works the same (LB_ADDSTRING, LB_FINDSTRING, etc.) but you need to provide drawing code. As an aside, the only Windows-provided control that you can change the font in (that I know of) is a dialog box. In this case add the DS_SETFONT attribute to the dialog style then send a WM_SETFONT message in the dialog's WM_INITDIALOG code. [Dang VI. How do you join lines again... ;-) ] Sorry it isn't easier. Ken Sykes Disclaimer: The above opinions are solely my own.