views:

84

answers:

2

Hi

How can I change the height of the column header in a ListView ?

(visual studio-2008,windows forms)

A: 

Hi,

Have a look at ObjectListView it supports a lot of customizations and you might find in there the way how to do it as it is open source.

Vinzenz
A: 

It is not easy but it can be done.

The basic strategy is to get the underlying header control from the ListView (using LVM_GETHEADER message), setup a NativeWindow instance on that control, and then listen for HDM_LAYOUT messages. In that message, you can specify the location and size of the header.

As the author of ObjectListView mentioned above, I have to say it's much easier to let someone else do all this work for you. ObjectListView uses dynamic header height to allow multiline headers and vertical text, like this:

alt text

alt text

Grammarian