更改TDBLookupComboBox中的下拉菜单项的颜色 [英] Changing the color of dropdown items in TDBLookupComboBox

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

问题描述

我想更改TDBLookupComboBox中的下拉菜单项的颜色(在Delphi 2007中).由于缺少OnDrawItem事件,因此这似乎很简单.有没有简单的方法可以做到这一点?

I want to change the color of the dropdown items in a TDBLookupComboBox (in Delphi 2007). This seems to be non-trivial due to the lack of an OnDrawItem event. Is there an easy way of doing this?

推荐答案

看起来不像.最简单的方法可能是创建一个从TDBLookupComboBox继承的新控件,并在其上实现OnDrawItem事件.您可能可以从TComboBox大量复制代码.只需确保对其进行了良好的测试即可.

Doesn't look like it. The easiest way would probably be to create a new control that descends from TDBLookupComboBox and implement an OnDrawItem event on it. You could probably copy the code pretty much wholesale from TComboBox. Just make sure to test it well...

这篇关于更改TDBLookupComboBox中的下拉菜单项的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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