3

Firstly, is there any way I can set the color of the available choices a combo box will offer me? I can change the background color of the text box part, but I am talking about the Drop Down list part? I want them to appear as the same color, instead of white.

Secondly, If I have a combo-box and set the Drop Down Style to Simple why does it then clear out the text box and not fill it with the selected item like it would if I had set the Drop Down style otherwise?

No real code examples to give here, just looking for information as opposed to answers.

user1708468
  • 195
  • 10
  • 2
    You can always create your own custom [User Controls](http://msdn.microsoft.com/en-us/library/c316f119%28v=vs.71%29.aspx) – huMpty duMpty Jul 15 '13 at 14:29
  • 1
    This [link](http://stackoverflow.com/questions/6468024/how-to-change-combobox-backgound-color-not-just-the-drop-down-list-part) here should get you started on it. – Chase Ernst Jul 15 '13 at 16:10
  • You need to draw your items yourself, instead of using default implementation. This is pretty much how all lists work. – T.S. Jul 15 '13 at 20:08
  • Thanks for the assist @ChaseErnst that told me how to do it, still not sure about the why mind you....... – user1708468 Jul 16 '13 at 08:29
  • @user1708468 When you say that it is clearing out the text box, and not filling it in witht he selected item. Are you saying that when you click the item in the dropdown box it does not get highlighted and get duplicated to the top of the combobox? – Chase Ernst Jul 16 '13 at 14:15

1 Answers1

0

What you referring as "choices the combo-box offer me" is not accurate..
Those are actually what the VS designer offering you.

Combo-box offers a lot more, but you will have to use code-behind to get to the flexibility you're looking for.

You can manually draw the items area - you can see the MSDN example here.
However, there are still limitations, I didn't see any way to draw the arrow down picture in example..
So yes.. it is limited in that sense.

If that limitation is acutic to you - you should use WPF.
(you can manage every aspect of your control using WPF.)

Regarding your 2nd question - This is probably some sort of bug, because when I tested that on my machine it worked as expected - filling the text area with the selected item text.

G.Y
  • 6,042
  • 2
  • 37
  • 54