如何制作自定义控件来更改列表框项目的颜色? [英] How to I make a custom control which changes the colour of a listbox item?

查看:129
本文介绍了如何制作自定义控件来更改列表框项目的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个电影和娱乐系统,允许用户选择电影.我要做的是制作一个自定义列表框控件,该控件显示电影列表,并且当用户选择电影时,列表框中的项目会更改颜色.现在,我知道如何制作自定义控件,但是我不知道更改控件的颜色部分需要什么代码?

Hi, I''m making a film and entertainment system which allows users to select films. What I want to do is make a custom listbox control which displays a list of films and when the user selects a film, the item in the listbox changes colour. Now I know how to make custom controls, but I don''t know what code is needed for the changing colour part of the control?

推荐答案

对于WindowsForms,需要一个查看此线程 [
For WindowsForms take a look at this thread[^].


这篇关于如何制作自定义控件来更改列表框项目的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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