列表框项目句柄 [英] list box items handle

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

问题描述

大家好!

我创建了一个包含五个项目的列表框

我想增加物品的高度

表示项目之间的距离

hi to all!

i create a list box with five items

i want to increase the height of items

means the distance between items

推荐答案

您可以使用ItemHeight属性.

当DrawMode属性设置为DrawMode.OwnerDrawFixed时,所有项目都具有相同的高度.当DrawMode属性设置为DrawMode.OwnerDrawVariable时,ItemHeight属性指定添加到ListBox的每个项目的高度.由于所有者绘制列表中的每个项目都可以具有不同的高度,因此可以使用GetItemHeight方法来获取ListBox中特定项目的高度.如果在具有可变高度的项目的ListBox上使用ItemHeight属性,则此属性返回控件中第一个项目的高度.
ListBox项的最大高度为255像素.
http://msdn.microsoft.com/zh-我们/library/system.windows.forms.listbox.itemheight.aspx [
You can use ItemHeight property.

When the DrawMode property is set to DrawMode.OwnerDrawFixed, all items have the same height. When the DrawMode property is set to DrawMode.OwnerDrawVariable, the ItemHeight property specifies the height of each item added to the ListBox. Because each item in an owner-drawn list can have a different height, you can use the GetItemHeight method to get the height of a specific item in the ListBox. If you use the ItemHeight property on a ListBox with items of variable height, this property returns the height of the first item in the control.
The maximum height of a ListBox item is 255 pixels.
http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.itemheight.aspx[^]


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

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