Pages

Thursday, November 22, 2012

Dirty tree view

Recently I have noticed strange behaviour with WinForms TreeView. I have worked on multiselect tree view, which is based on simple treeView and noticed this:
After clearing long node text there is blue rectangle - right as this text was before deleting. It is not very bad, but it seems like a bug. I have checked all my code, but was not able to find the reason for this. At the end I tried to reproduce this behavior in the prototype, and I have found that problem not in my multiselect tree, but in the .Net.

I have found two solutions for this problem:
  • You can enable FullRowSelect in your tree. As for me, it looks much more stylish than simple selecting, so I choose this option;
  • Or you can disable visual styles in your application. To disable visual styles simply comment out Application.EnableVisualStyles(); in your main() function.

No comments:

Post a Comment