TreeView flickering while searching nodes

  • Thread starter Charles Crawford
  • Start date
C

Charles Crawford

Hi,

I see a lot about TreeView flickering while adding nodes to a treeview
control, but not really about what I'm experiencing.

I'm adding nodes to a TreeView control, but first, to ensure I don't
already have a node somewhere in the tree with the same name, I
perform a recursive search of the nodes for nodes containing a
specified text value. The TreeView control flickers while searching
the nodes.

I've tried using .SuspendLayout() and .ResumeLayout() before and after
each search is initiated, but it still flickers. Any ideas on how I
can keep the control from flickering while searching the nodes?

Thanks,

Charlie
 
T

Tom Dacon

Are you by chance setting any TreeViewor TreeNode properties during your
recursive search, such as SelectedNode? Iterating recursively over the Nodes
collections of TreeNodes doesn't seem to cause anything like that for me.

Tom Dacon
Dacon Software Consulting
 
G

G Himangi

Make sure you call BeginUpdate before adding large number of nodes and
EndUpdate afterwards.

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
 

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