This would seem to be a simple task but I can't seem to find a way to do it except to implement some seriously complicated Windows MenuEx API stuff -
All I want to do is insert a horizontal divider in a combo dropdown box, to give visual separation between groups of items. My purpose really is that the items in the box will be fluid, except for a certain set of items which are special items that will always be there.
Using VB2005, .NET 2.0 - anyone know a way to do this
Thanks,
Patrick

Horizontal divider line in Combo Box
Zoidberg
Here's a link to the project I posted:
http://www.thecodeproject.com/useritems/IconComboBox.asp
Hope it helps someone.
Patrick
Kerilk
By the way, I found a way (the only way) to do this -
I extended the ComboBox control by inheriting from it (so that the combobox would be responsible for the contained ListBox it uses to implement the drop down) and merely overrode the OnDrawItem method.
I then created a custom collection, which contains custom items; each item records what its actual data is, and what to display; and it contains a Friend (internal in C#) property for creating divider elements (this way, I dont' have to handle dividers separately from actual display items, save to skip them if they get selected).
Finally, in the OnDrawItem method, I simply check to see if the item is a divider, and if so, draw a line instead of rendering the item.
I also added support for giving each item an icon, which is disgustingly easy to render, actually.
If anyone is interested email me and I will send you the code. I am going to post this code on the CodeProject website so I may follow up this post with a link there.
mahenj
Great you found a way to do it. Please post a link here when you have published it.