Underlining TreeNode makes TreeView flicker

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
 
D

Dmytro Lapshyn [MVP]

Hi,

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

myTreeView.HotTracking = true;

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top