Is there a way to get the listview header background color?

  • Thread starter Thread starter jrhoads23
  • Start date Start date
J

jrhoads23

I am looking for a way to get the background color of a listview header
(when in Details view)
I have found a couple various threads on how to change the background
color, but I have yet to find out how to GET the background color. 99%
of the time it is Control, but I want to be able to get it.

Thanks!
 
I am not sure if there is a specific way to change the background color
of a ListView's Header control. There may be Win32 Specific messages
that allow a user to change it manually. In which case there would be
Win32 specific messages to retrieve the background color most likely.
However, it is advised that you do not use this methid for portability
and security reasons.

The other method a header's background color could be overriden would
be through custom painting. If this is the case then this is up to the
implementer. Therefore the only real way would be to make a call to
GetPixel. This method once again has alot of obstacles and conditions.

I honestly would wonder if it was worth all of the trouble. Without
knowing your specific usage scenarios I can't really say much more.
 
Hiya,

I think your right. If you are not specifically changing itm then it
would be SystemColors.Control. I know this wont GET you the color, but
as you've said thats what I would suspect it to be.

Hope this helps.

Simon Rigby
 
Back
Top