vb.net - 我可以在 listviewitem 子项中加粗一个单词吗?
问题描述
我可以在列表视图中做这样的事情吗?
1 | 富 | 酒吧12 | x |
2 | 富 | 32酒吧| 是 |
在这种情况下,我想加粗特定的单词“bar”。
是否可以在列表视图中使用,或者是否有任何替代方法可以使其工作?
解决方案
这可能对你有用...
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)
推荐阅读
- postgresql - Postgres 恢复缺失的权限
- vue.js - 我想在使用 v-menu v-list 更新时隐藏所选内容
- java - 从具有不同功能的两个表(在 postgreSQL 中)映射 Hibernate 中的一个实体
- dart - 创建与给定对象具有相同类的新对象
- c++ - “Magick++::readImages”在我调用它来解码 Blob 对象内的 png 图像时会引发警告
- python - 在 scipy.stats 中定义用于 trapz 分布的 pdf 背后的逻辑
- ag-grid - 用于小数的 Ag-grid 数字过滤器(错误?)
- android - 单击 Web 容器上的链接总是强制关闭应用程序
- sql - SQL:向后获取时间序列的结果
- azure - 在向 Azure 市场提供 VM 期间将自定义数据字段添加到 VM