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

前端 未结 6 1394
轻奢々
轻奢々 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 21:20

    For the people that are still struggling with this, here is the code I use:

    private void SetHeight(ListView listView, int height)
    {
        ImageList imgList = new ImageList();
        imgList.ImageSize = new Size(1, height);
        listView.SmallImageList = imgList;
    }
    

    To use this, just do:

    SetHeight(lvConnections, 25);
    

提交回复
热议问题