I am wrestling with RELIABLY changing the background color of the VB TreeView control.
Microsoft has published a solution that uses calls the following Windows API functions: SendMessage, GetWindowLong,
SetWindowLong:
This works fine but only if the TreeView Style property is set to tvwPlusMinusText. But on this setting the text of Nodes with certain characters (eg -, ] = >) is garbled, and, worse, sometimes entire child branches fail to appear.
I was originally using the tvwTreeLinesPlusMinusText Style,
which does not have these quirks, but SOMETIMES the background color of the Node is white. (The background colour of each Node is set via .Nodes(intNode).BackColor = strColor). This produces ungainly white boxes randomly scattered up an down the left hand side of the tree. Switching between LineStyles tvwTreeLines and tvwRootLines doesn't help.
If anyone has any suggestions on how to fix this issue it would be much appreciated.
Microsoft has published a solution that uses calls the following Windows API functions: SendMessage, GetWindowLong,
SetWindowLong:
This works fine but only if the TreeView Style property is set to tvwPlusMinusText. But on this setting the text of Nodes with certain characters (eg -, ] = >) is garbled, and, worse, sometimes entire child branches fail to appear.
I was originally using the tvwTreeLinesPlusMinusText Style,
which does not have these quirks, but SOMETIMES the background color of the Node is white. (The background colour of each Node is set via .Nodes(intNode).BackColor = strColor). This produces ungainly white boxes randomly scattered up an down the left hand side of the tree. Switching between LineStyles tvwTreeLines and tvwRootLines doesn't help.
If anyone has any suggestions on how to fix this issue it would be much appreciated.