将ListView中的所有项目居中 [英] Center all items in a ListView

查看:603
本文介绍了将ListView中的所有项目居中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,必须有类似的十二种不同的解决方案来集中ListView列中的所有项目,但它们都不起作用。这有可能吗?我甚至试过这个:



theListViewItem.Position = new Point(theItem.Position.X + 50,theItem.Position.Y);

b
并且没有用。我甚至在调试器中插入了值,但仍然无法正常工作。有什么建议?



Okay there has to be like a 1/2 dozen different solutions to center all the items in a ListView columns and none of them work. Is this possible at all? I even tried this:

theListViewItem.Position = new Point(theItem.Position.X + 50, theItem.Position.Y);

and it did not work. I even inserted the value in the debugger and still did not work. Any suggestions?


推荐答案

您可以将列对齐设置为居中列表视图中心。

You can set column alignment to centre to centre listview items.

请注意,第一列不能居中,所以只需创建宽度为0的列。

Note that the first column cannot be centred so just create it with width 0.

Andy


这篇关于将ListView中的所有项目居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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