Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!sdd.hp.com!ncr-sd!mars!carlc From: carlc@mars.SanDiego.NCR.COM (Carl Christofferson) Newsgroups: comp.windows.ms Subject: Re: Setting ListBox font Message-ID: <2915@ncr-sd.SanDiego.NCR.COM> Date: 27 Aug 90 16:09:06 GMT References: <1355@msa3b.UUCP> Sender: news@ncr-sd.SanDiego.NCR.COM Reply-To: carlc@mars.SanDiego.NCR.COM (Carl Christofferson) Organization: NCR Corporation, Rancho Bernardo Lines: 24 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, ...); > If your list box is in a dialog box, its real simple. First, get a handle to the desired font, hDesiredFont = GetStockObject (XXX_FONT); // I used SYSTEM_FIXED_FONT Then, in the WM_INITDIALOG in your dialog box code, send a WM_SETFONT message to the list box: case WM_INITDIALOG: SendDlgItemMessage (hDlg, ID_CONTROL, WM_SETFONT, hDesiredFont, 0L); // ID_CONTROL is the ID you gave to your list box, ie IDL_LISTBOX // other code as desired break; That's it! Hope this helps. Carl Christofferson carlc@mars.SanDiego.NCR.COM disclaimer: Any opinions expressed are entirely my own ...