How do I determine the dimensions of a .NET listview at runtime?

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-05-04T12:37:46Z Indexed on 2010/05/04 12:38 UTC
Read the original article Hit count: 211

Filed under:
|
|

I have a form with a split container and each panel has a list view and some buttons. I wanted to make sure that the header and at least two rows are visible in a listview. I originally determined the values for panel1MinSize & panel2MinSize by fine tuning the values visually (on my XP development machine). This approach was fine until I tested my app on Windows Vista - the basic dimensions of the listview are different and the listview is too small.

To overcome this I believe I need to determine the listview dimensions at runtime and do some maths to set the panel min size but I can't see how to do this. Is this the right approach or is there an easier way?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET