How to increase TListView row height

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

How to increase TListView row height

Postby rajesh » Thu Jul 25, 2019 12:57 am

Hello ,
I am using the TListView , Now I want different row uses different height due to different font size . How to do this
rajesh
Top Poster
Top Poster
 
Posts: 47
Joined: Mon Oct 26, 2009 1:25 am

Re: How to increase TListView row height

Postby HsiaLin » Thu Jul 25, 2019 1:39 am

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.
HsiaLin
BCBJ Master
BCBJ Master
 
Posts: 316
Joined: Sun Jul 08, 2007 6:29 pm

Re: How to increase TListView row height

Postby rlebeau » Fri Jul 26, 2019 11:32 am

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.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1609
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA


Return to Technical

Who is online

Users browsing this forum: No registered users and 13 guests

cron