C# Change ListView Item's/Row's height

前端 未结 6 1398
轻奢々
轻奢々 2020-12-08 20:43

I want to change the Item\'s/Row\'s height in listview.

I searched every where and I figured that in order to change the height I need to use LBS_OWNERDRAWFIXE

6条回答
  •  温柔的废话
    2020-12-08 20:57

    You have to use a bit of a hack. The trick is to use an image list in the StateImageList property. The ListView will adjust its item height, based on the height of the ImageList's ImageSize property. You do not have to specify an image for your items, but just using the StateImageList will force the ListView to adjust. In the example below, I had set the image list size to 32x32, thus resulting in a 32px height ListViewItem(s).

    enter image description here

提交回复
热议问题