VB.net Color文本的一部分 - Listbox

时间:2010-06-01 01:22:10

标签: .net vb.net text listbox colors

在VB.net中,无论如何要使字符串的某个部分具有不同的颜色以使其脱颖而出?

这不起作用,但如果我可以这样的话

string = ("How".ForeColor(red) & "are".FontColor(green))

是否可以在ListBox中制作类似的内容?

如果无法做到这一点有没有办法让它脱颖而出?

1 个答案:

答案 0 :(得分:1)

您必须覆盖列表框DrawItem方法。

与此类似:Change the Color of Individual .Net ListBox items