Listview-列宽 [英] Listview - column width

查看:82
本文介绍了Listview-列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图找出如何测量列宽.

例如:

ListView1.Columns.Add("Capacity",100,Horizo​​ntalAlignment.Center)

这个数字等于100像素吗?还是其他测量方法?

我想知道,以便当程序在不同的操作系统上运行时,可以对列表视图的外观进行调整.

我在XP机器上对齐了列,然后在Vista笔记本电脑上运行程序时,在右侧填充了一个空白列.

我对如何防止这种情况一无所知,更改屏幕分辨率并不能改变外观.

提前谢谢您!

困惑的程序员

I''m trying to find out how the width of a column is measured.

For example:

ListView1.Columns.Add("Capacity", 100, HorizontalAlignment.Center)

Does that number mean 100 pixels? Or is it some other measurement?

I''d like to know so that I can make adjustments for the appearance of the listview when the program is running on different operating systems.

I aligned the columns on an XP machine, and when I run the program on my Vista laptop an extra blank column gets padded to the right side.

I have no clue as to how to prevent this from happening, and changing the screen resolution doesn''t do anything to change the appearance.

Thanking you in advance!

Baffled Programmer

推荐答案

AFAIK,宽度属性使用像素.

此外,您可能希望在此处 [ ^ ]来解决您的问题.
AFAIK, the width peroperty uses pixels.

Further, you might want to have a look here[^] to get some ideas to solve your problem.


这篇关于Listview-列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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