Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!ntvaxb!ie15 From: ie15@vaxb.acs.unt.edu Newsgroups: comp.os.os2.programmer Subject: Re: OWNERDRAW hItem/Changing control window's output Message-ID: <33603.26e0f210@vaxb.acs.unt.edu> Date: 2 Sep 90 11:50:39 GMT References: <1990Aug2.135426.23195@arnor.uucp> <953@metapyr.UUCP> <33584.26dfbad5@vaxb.acs.unt.edu> <1990Sep1.201044.9743@evax.arl.utexas.edu> Lines: 31 Hey Adam, List boxes do have settable fonts. So do most all PM controls now in 1.2 Using WinSetPresParams() you can tell a control to set his colors as well as his font. for example HWND hControl; ULONG color; CHAR font[20]; hControl =WinWindowFromID( hwnd, LB_ITEMS); /* Assuming a window with a listbox with an ID of LB_ITEMS */ strcpy( font, "12.Courier"); WinSetPresParams( hC, PP_FONTNAMESIZE, sizeof( font), font); This is a cheap way to get the columns of a listbox to line up, but hey. color =CLR_YELLOW; WinSetPresParams( hC, PP_FOREGROUNDCOLORINDEX, sizeof( ULONG), &color); color =CLR_BLUE; WinSetPresParams( hC, PP_BACKGROUNDCOLORINDEX, sizeof( ULONG), &color); This will change the listbox to do all its output in yellow on blue. Pretty useful. But remember, the user changed his system colors with the control panel. We should use these APIs with a clear head and proper judgement else we fall prey to congression regulators regulating our user-interface code. Ken Tabor University of North Texas