How to change the BackColor of a ComboBox when Dro

2019-06-18 04:10发布

I'm trying to change the dispaly color of a ComboBox when the DropdownStyle property is DropdownList. When the property is changed to Dropdown from DropdownList the color changes.

How can I control the view color of the dropdown boxes ?

Thanks

1条回答
放我归山
2楼-- · 2019-06-18 04:45

You can set FlatStyle property to Popup. This way the back color will use in both DropDown and DropDownList mode.

If you don't like flat style or you need more customization on rendering of ComboBox, you can use an owner-drawn ComboBox. For example you can set DrawMode property to OwnerDrawFixed and handle DrawItem event and draw the combo box based on your logic.

查看更多
登录 后发表回答