I derived a class from ComboBox, made it an owner drawn list box (DrawMode.OwnerDrawVariable style), and by overriding OnMeasureItem and OnDrawItem I add special items to the drop-down list (separators, for example) which are of a smaller/larger size than the normal items that inhabit the control.
Now, the problem I'm having and can't seem to effectively remedy is the sizing of the drop-down list: there's an ugly empty space at the end of the list when it drops down. I thought I tackled this by setting the DropDownHeight property of the ComboBox to the sum of all the items' height, but this doesn't seem to work all the time. Sometimes, on a random number of items, the Empty White Space of Doom returns. This is an unusual problem, but hopefully a common and easily fixed one.
How can I get the ComboBox's drop-down list to size precisely to the size occupied by the items inside of it?