如何在vb.net中增加listview的默认vscrollbar [英] How to increase default vscrollbar of listview in vb.net

查看:145
本文介绍了如何在vb.net中增加listview的默认vscrollbar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends ...



当垂直滚动条变得可见时,它会改变列表视图的内部宽度,因此总列宽+宽度垂直滚动条变得比列表视图宽。为确保水平条不可见,请使其中一列的宽度略微偏小。玩弄宽度直到水平条没有出现



请快速重播



谢谢

Hello Friends...

When the vertical scrollbar becomes visible, it changes the inside width of the listview, so the total column width + the width of the vertical scrollbar becomes wider than the listview. To assure the horizontal bar does not become visible, make the width of one of the columns slightly less than usual. Play around with the width until the horizontal bar doesn't appear

Please Fast Replay

Thanks

推荐答案





这里有一些关于ListView的提示。

ListView.Size - 给出控件的总大小(宽度和高度)

ListView.ClientSize - 为您提供绘图的总可用区域(宽度和高度)



因此,您可以计算总宽度和客户端宽度之间的差异:

var diff = listView1.Size.Width - listView1.ClientSize.Width;



由于边框等原因,通常diff值大约为4像素。如果出现垂直滚动条,那么(在我的电脑上)差异大约为21像素。



您可以处理窗体或listview的ClientSizeChanged事件,以便在控件区域更改时调整列的宽度。



此外还有ListView控件的一些属性在设计模式下不可用,但您可以在代码中设置它们:

ListView.AutoResizeColumn i ListView.AutoResizeColumns

用于设置特定列或所有列调整样式。



这里有一些链接:

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.size%28v= vs.110%29.aspx [ ^ ]

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.clientsize%28v=vs .110%29.aspx [ ^ ]

< a href =http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged%28v=vs.110%29.aspx> http://msdn.microsoft.com /en-us/library/system.windows.forms.control.sizechanged%28v=vs.110%29.aspx [ ^ ]

http://msdn.microsoft.com/ en-us / library / system.windows.forms.control.clientsizechanged%28v = vs.110%29.aspx [ ^ ]

http://msdn.microsoft.com/en -us /库/ system.windows.forms.listview.autoresizecolumn%28V = vs.110%29.aspx [<一个href =http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.autoresizecolumn%28v=vs.110%29.aspxtarget =_ blanktitle =New Window > ^ ]

http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.autoresizecolumns%28v=vs.110%29.aspx [ ^ ]



我希望它可以帮到你。
Hi,

Here you have some hints about ListView.
ListView.Size - gives you total size of control (width and height)
ListView.ClientSize - gives you total available area for drawing (width and height)

So, you can calculate difference between total width and client width:
var diff = listView1.Size.Width - listView1.ClientSize.Width;

Normally diff value will be around 4 pixels because of border and etc. If vertical scrollbar appears then (on my computer) diff is around 21 pixels.

You can handle form's or listview's ClientSizeChanged events to adjust column's width when control area was changed.

Additionally there are some properties of ListView control not available in design mode but you can set them in your code:
ListView.AutoResizeColumn i ListView.AutoResizeColumns
which are used to set specific columns or all columns resize style.

Here you have some links:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.size%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.clientsize%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.clientsizechanged%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.autoresizecolumn%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.autoresizecolumns%28v=vs.110%29.aspx[^]

I hope it help you.


这篇关于如何在vb.net中增加listview的默认vscrollbar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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