Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the height of a ListView item?

I have ListView and I need to determine item height.

like image 608
treetey Avatar asked Dec 07 '22 20:12

treetey


2 Answers

You can use the GetItemRect() method:

int itemHeight = yourListView.GetItemRect(itemIndex).Height;
like image 55
Frédéric Hamidi Avatar answered Dec 19 '22 11:12

Frédéric Hamidi


I am not 100% sure but this might help:

int itemHeight = listView.Items[itemIndex].GetBounds(ItemBoundsPortion.Entire).Height;
like image 24
Renatas M. Avatar answered Dec 19 '22 11:12

Renatas M.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!