Page 1 of 1

How to increase TListView row height

PostPosted: Thu Jul 25, 2019 12:57 am
by rajesh
Hello ,
I am using the TListView , Now I want different row uses different height due to different font size . How to do this

Re: How to increase TListView row height

PostPosted: Thu Jul 25, 2019 1:39 am
by HsiaLin
If your listview uses a TImageList, you can set the imagelist Height property to whatever
you want the row height to be. If you don't use an imagelist, you`ll probably have to use the
CustomDraw method.

Re: How to increase TListView row height

PostPosted: Fri Jul 26, 2019 11:32 am
by rlebeau
rajesh wrote:I am using the TListView , Now I want different row uses different height due to different font size . How to do this


Are you using VCL or FMX?

Not sure about FMX's TListView, but VCL's TListView does not allow you to have rows with different heights. VCL's TListBox does, though, via its lbOwnerDrawVariable style and OnMeasureItem event.

HsiaLin wrote:If your listview uses a TImageList, you can set the imagelist Height property to whatever
you want the row height to be. If you don't use an imagelist, you`ll probably have to use the
CustomDraw method.


That doesn't allow different rows to have different heights from each other. You would have to use one max height for all of the rows, and then owner-draw items with varying text heights, which will leave extra whitespace for items with smaller text heights.