How could I populate a ComboBox (or a ToolStripComboBox like in the image) with line styles .NET?
alt text http://lh4.ggpht.com/_1TPOP7DzY1E/S9ASrI4TE8I/AAAAAAAADKo/pNzm6MVyYkA/s800/linestyles.png
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to draw the items yourself. The ComboBox has a
DrawItemevent 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.