TreeView flickering while searching nodes

  • Thread starter Thread starter Charles Crawford
  • Start date 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
 
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
 
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
 
Back
Top