6

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

(visual studio-2008,windows forms)

default locale
  • 12,495
  • 13
  • 55
  • 62
Anees
  • 885
  • 4
  • 13
  • 31

2 Answers2

3

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
  • 6,559
  • 1
  • 16
  • 32
1

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
  • 2,709
  • 16
  • 23