更改组合框的颜色 [英] changing color of combo box

查看:80
本文介绍了更改组合框的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码中有一个组合框.它的下拉样式设置为drop donw.

选择项目时,组合框中将显示蓝色.

由于该选定值不可见.因此,我想将蓝色更改为某种颜色,变成白色.告诉我答案.

I have a combo box in my code. it''s dropdown style is set drop donw.

When selecting an item blue color appears in combo box.

Because of that selected value is not visible. So I want to change that blue to some color to white.tell me the answer.

推荐答案



试试这些:

Hi,

Try these:

private void Form1_Load(object sender, EventArgs e)
{
    donw.BackColor = System.Drawing.Color.White;
    donw.ForeColor = System.Drawing.Color.DarkBlue;
    //.. some code here...
}



请记住是否可以投票...

关于



Remember to vote if could help...

Regards,


AFAIK,没有工具可以更改ComboBox的选定项目"颜色-它使用Windows默认设置.可以更改它,但是我不会,因为它可能会激怒您的用户.如果应用程序对我的系统执行了此操作,它将立即被卸载,而我会找回我的钱.

您可以处理ComboBox的Paint事件并自己绘制文本/选择状态,但是我从未尝试过,所以我不能说涉及到多少工作.

如果可以的话,我会找到另一种解决您的问题的方法-通常这不是问题,那么为什么在您的应用程序中出现问题?
AFAIK, there is no facility to change the Selected Item color for a ComboBox - it uses the Windows default. It is possible to change that, but I wouldn''t as it will probably annoy your users no end. If an application did that to my system, it would get uninstalled immediately, and I would be looking for my money back.

You could handle the Paint event for the ComboBox and draw the text / selection status yourself, but I''ve never tried so I can''t say how much work is involved.

I would find another way round your problem, if I could - it isn''t normally a problem, so why is it one in your app?


这篇关于更改组合框的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆