I'm trying to change the TreeView
's default highlight color
. I would have expected something like DefaultSelectionBackground
like I do in a DataGridView
, but I can't find anything.
Is this just another limitation of the TreeView
, or am I missing something?
All standard Windows controls, like TreeView, pay attention to the theme colors selected by the user. That's an asset, windows are recognizable and familiar, even if the user has never used a program before. The default highlight color is white on blue, standard for every control. And of course customizable by the user, TreeView automatically follows suit.
You can force your own color preference on the user if you really want to. Set the DrawMode property to OwnerDrawText and implement the DrawNode event to draw yourself. There's a good example for it in the MSDN Library article for DrawNode.
HTML
Code behind