我可以在listviewitem子项目中加粗一个单词吗?

时间:2018-07-03 07:23:21

标签: vb.net winforms

我可以在列表视图中做类似的事情吗?
1 | foo | 12 | x |
2 | foo | 32 | y |

在这种情况下,我想将特定的单词“ bar”加粗。
可以在列表视图中使用,还是有其他选择可以使其正常工作?

1 个答案:

答案 0 :(得分:1)

这可能对您有用...

    Dim item1 As New ListViewItem
    item1.Text = "Item 1 BOLD"
    item1.UseItemStyleForSubItems = False      'Set this to FALSE to allow changing the subitem font. It is TRUE by default.
    item1.Font = New Font(ListView1.Font, FontStyle.Bold)
    item1.SubItems.Add("Sub Item Normal")
    item1.SubItems(1).Font = New Font(ListView1.Font, FontStyle.Regular)

    ListView1.Items.Add(item1)
相关问题