Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Color Highlight of ListBox or ComboBox Entries
#14
Hello, 

I'm using the above functions   CB_ItemColor,  dialog_combo_item_colors  and   SampleCbItemColorProc  (which are also supplied in the archive) to change the color of some items in a listbox, and it works. Thanks for supplying these functions. 

I would also like to change the fontsize for all items in the listbox. I've placed the following lines after WM_INITDIALOG message to change the font of my listbox which has identifier 3:

        __Font-- dfont
        dfont.Create("Arial" 18 1)
        dfont.SetDialogFont(hDlg "3")

The listbox font indeed changes to size 18, but now the items in the listbox overlap (not enough vertical space is used to draw the items).   When I don't use the LBS_OWNERDRAWFIXED style the items don't overlap and have the right fontsize, but then of course the coloring of the items doesn't work. 

I've also tried to place the lines above before the call to CB_Itemcolor, but it doesn't work. 

Is there a way to change the code in the functions above so that I can change the fontsize of the list box but so that the items don't overlap.  If it is possible, what would the code look like?

Thanks, 
Artuur.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)