How do I determine the dimensions of a .NET listview at runtime?
- by Dave
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?