How do I get the header height of a list - c #

advertisements

Can sombody tell me how to get the header height of a list view.

Thanks


This might be a little bit hacky but you can do:

listView.Items[0].Bounds.Top

This will only work if there is only one item in the list. So you might want to temporarily add one when you first create the list and keep the height value.

Else, you can always use:

listView.TopItem.Bounds.Top

To make the test at any moment, but you still need at least one item in the list.