加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

vb.net – 文本列表视图中的对齐列:第一列无法居中

发布时间:2020-12-17 00:21:44 所属栏目:大数据 来源:网络整理
导读:我有详细模式的Listview有3列.我想将标题的文本对齐设置为“居中”.这适用于最后两列但不适用于第一列.如果我想将其更改为“center”并单击“center”,则该字段将保持设置为“left”.我可以使用属性更改此属性还是需要对此进行编程? 谢谢. 根据 the documen
我有详细模式的Listview有3列.我想将标题的文本对齐设置为“居中”.这适用于最后两列但不适用于第一列.如果我想将其更改为“center”并单击“center”,则该字段将保持设置为“left”.我可以使用属性更改此属性还是需要对此进行编程?

谢谢.

根据 the documentation:

Due to a limitation in the underlying control,this property has no effect on the first column in the ListView control,which is always aligned to the left. To work around this limitation in .NET Framework version 2.0,you can handle the 07001 event and paint the column header yourself.

另一种替代解决方法是根本不使用第一列,并通过将其width设置为零来隐藏它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读