views:

26

answers:

1

How could I populate a ComboBox (or a ToolStripComboBox like in the image) with line styles .NET?

alt text

+1  A: 

You need to draw the items yourself. The ComboBox has a DrawItem event for that. You can get both the boundaries of the item and the graphics context from the event arguments.

You'll need to set the DrawMode property on the ComboBox to OwnerDrawFixed for that to work, though.

I'm assuming that finding the DashStyle enumeration and creating an item for each enum value is not your problem here.

Joey
Thanks. Did't tryed, however, but after some reflections reformulated in this: http://stackoverflow.com/questions/2690044/display-colorpicker-net
serhio
Could I use the same things for the example in the question from the link?..
serhio