CComboBox上的setCurSel不同颜色 [英] setCurSel on a CComboBox a different color
问题描述
我有3个不同条目的简单comboBox.当用户选择其中一个条目时,我希望将其显示为另一种颜色,但仅适用于其中一种可能的选择.
假设我在组合框中选择了这3个项目,
苹果
香蕉
橘子
如果用户选择Apple/橙色,我希望组合框能正常工作,但是如果用户选择香蕉",例如,一旦做出选择,我想将背景色更改为红色..
有一个简单的方法吗?
问候,
Hi,
I have simple comboBox with 3 different entries. When the user selects one of the entries, i would like to have it diplayed as a different color but for only one of the possible selections.
Assume i have those 3 items as possible selection in the combo box,
Apples
Bananas
Oranges
If the user selects Apple/oranges, i would like the combo box to behave normally, but if the user selects Banana, i would like to change the backgroung color to red for example once the selection is made..
is there an easy way?
Regards,
推荐答案
一种方法是处理OnCtlColor.请参阅以下链接,(特别是备注"列).
http://msdn.microsoft.com/en-us/library/0wwk06hc%28v = vs.80%29.aspx [ ^ ]
One way is to handle OnCtlColor.Refer the following link,(Perticularly Remarks column).
http://msdn.microsoft.com/en-us/library/0wwk06hc%28v=vs.80%29.aspx[^]
这篇关于CComboBox上的setCurSel不同颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!