I wonder if someone knows a way to change the height of a combobox. The height parameter is only used for the drop down menu so that I don't see an obvious way of reducing the size of the editbox/button part.

Posted on 2007-03-28 13:14:57 by JimmyClif
I don't think you can do that - it's autosized by the font that's selected into it, iirc.
Posted on 2007-03-28 17:18:10 by f0dder
Doesn't CBS_NOINTEGRALHEIGHT work on the edit part?
Posted on 2007-03-28 18:57:27 by sinsi
You might want to look into OwnerDrawn ComboBoxes.
Posted on 2007-03-29 01:27:29 by Homer
Homer s right, create your combo with CBS_OWNERDRAWFIXED and draw the strings, selection (and icons?) inside WM_DRAWITEM. You receive once a WM_MEASUREITEM message where you can change the height to any number of pixels.
case WM_MEASUREITEM:
  MEASUREITEMSTRUCT *lpMeasureItem = (MEASUREITEMSTRUCT*)lParam;
  if (wParam == IDC_COMBO1)
  {
     lpMeasureItem->itemHeight = 8; return true;

Note the CBS_OWNERDRAWFIXED style automatically increases the combo height, so correcting this is neccesary
Attachments:
Posted on 2007-03-29 03:39:21 by sapero
Thanks guys... Looking for ownerdrawn comboboxes I found Donkey's example and I'll have a look at that today. I also consider a custom control. (After all, a combobox is just an edit window, a listbox and a button.)
Posted on 2007-03-29 06:21:26 by JimmyClif