如何为两列ListView设置两个不同的字体? [英] How to set two different Fonts for two columns of ListView?

查看:206
本文介绍了如何为两列ListView设置两个不同的字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#.net创建一个Windows应用程序。在一个窗体上,我有一个带有两个列的ListView,一个包含UserID&其他包含UserName.I想为这两列设置两种不同的字体(如Century SchoolBook& Monotype Corsiva)。
我该如何做到这一点?请帮助我。
谢谢。

解决方案

将这两列作为标签列,然后您可以轻松设置两个不同的字体不同的标签。

以下示例解释了如何将按钮添加到列。同样的逻辑可以用来添加标签。

将按钮添加到WinForms的ListView中


I am creating an windows application by using C#.net.In that on one form,i've a ListView with two Columns,one Containing UserID & Other Containing UserName.I would like to set two Different Fonts(like Century SchoolBook & Monotype Corsiva) for these two Columns. How can i achieve this?Please Help me. Thank You.

解决方案

Make these two columns as label columns and then you can easily set a different font for two different labels.

Following example explains how a button is added to a column. Same logic can be used to add labels.

Adding button into a Listview in WinForms

这篇关于如何为两列ListView设置两个不同的字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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