Underlining TreeNode makes TreeView flicker

  • Thread starter Thread starter Fran Garcia
  • Start date Start date
F

Fran Garcia

Hi,

I've implemented a TreeView that underlines the node under mouse location
(like Windows Explorer does), but I have a flicker problem, because the
entire TreeView is repainted whenever I change the NodeFont property of any
of it's child nodes.

Whenever the mouse moves over a tree node, I set the NodeFont property of
the node to an underlined font and, if there was an underlined node, that
one is set a regular font.

I've tried to wrap the NodeFont = font line between TreeView.SuspendLayout
and TreeView.ResumeLayout(false), but it doesn't help.

Any advices?

Thanks in advance
 
Hi,

Would it be sufficient for your purpose to use the built-in hot-tracking
feature:

myTreeView.HotTracking = true;

?
 
Back
Top