【问题标题】:VB.net Color one part of text -- ListboxVB.net 为文本的一部分着色——列表框
【发布时间】:2010-06-01 01:22:10
【问题描述】:

在 VB.net 中是否有让字符串的某个部分具有不同的颜色以使其突出?

这行不通,但如果我可以这样的话

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

是否可以在 ListBox 中制作类似的东西?

如果这是不可能的,有没有办法让它更加突出?

【问题讨论】:

    标签: .net vb.net text listbox colors


    【解决方案1】:

    您必须重写 ListBox 的 DrawItem 方法。

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

    【讨论】:

    • 我已将其转换为 VB.net,但我不知道如何更改列表框项的颜色。
    猜你喜欢
    • 1970-01-01
    • 2012-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多