Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!dkuug!rcbal!neh From: neh@rci.dk (Niels Erik Holm) Newsgroups: comp.windows.ms.programmer Subject: Re: HOW CAN I GET COURIER (ie ANSI_FIXED_FONT) IN A LISTBOX ????? Message-ID: <1991May07.063257.2529@rci.dk> Date: 7 May 91 06:32:57 GMT References: <6310@vela.acs.oakland.edu> Organization: RC International, Copenhagen, Denmark Lines: 35 rdthomps@vela.acs.oakland.edu (Robert D. Thompson) writes: > I need to get a listbox to display it's contents in the > COURIER font. Although the SDK clearly shows how to select > font stock objects and print corresponding text output > via TextOut and other device oriented functions, I cannot > seem to get a listbox to display it's contents in a > font other than the system font. > Do I need to make an "OWNER_DRAW" listbox or something ??? No, you do not have to make an owner drawn listbox control. The method is to send a WM_SETFONT message to the control. I.e. HFONT font; font = CreateFont (....) SendDlgItemMessage(hDlg,LISTBOX,WM_SETFONT,(WORD)font,(LONG)TRUE); I haven't tried this, when the listbox is NOT part of a dialog box, but I assume the method is similar. Niels Erik Holm RC International Denmark --------------------------------------------------------------------------- Every day, once a day, give yourself a present. Don't plan it, don't wait for it, just... let it happen. Could be a new shirt at the men's store, a catnap in your office chair, or two cups of good, hot, black coffee. (Dale Cooper in Twin Peaks). ---------------------------------------------------------------------------