Hello,
I am creating a custom combobox which can draw separators. So, I override OnDrawItem() and OnMeasureItem() methods.
The problem is that OnMeasureItem() is called only once when datasource is changed. So if I want to specify a separator item later I need to remeasure it's height (because items with separator should be taller), but it seems that all methods that can lead to item height being remeasured are private, so I can't call them.
I don't know if it's easy to understand what I've written above, so I will repeat what I need:
I need to remeasure item height (OnMeasureItem() must be called) each time when I specify that the item should be drawn with a separator.
separatorableComboBox.DataSource = customers;
// and now I want the third customer in the list to be drawn with a separator,
// so it needs to be taller and therefore OnMeasureItem() should be called
separatorableComboBox.SpecifySeparatorItem(customers[2]);
UPD. Guys, calling RefreshItems() works, but it's very slow (> 20 ms on my machine), are there faster methods?
UPD2. Right now I am using SendMessage(..., CB_SETITEMHEIGHT, ...); method as serge_gubenko advised. But I'm just curious if there is a fast way of accomplishing the task with .NET (or more specifically with ComboBox class itself)?