
TreeView control : Is there somthing like Redraw = False (MSFlexGrid)
Hi
I answered this one last month (people really should check the
www.dejanews.com site more often)
Here goes...
There are several ways of speeding up the processing of the treeview
1. Lock the window on any large update (ie. Cut / Copy / Paste)
I use code like :
Private Sub LockTreeView(ByVal bLock as Boolean)
If bLock Then
SendMessageLong tvTree.hwnd, WM_SETREDRAW, 0, ByVal 0&
Else
SendMessageLong tvTree.hwnd, WM_SETREDRAW, 1, ByVal 0&
End If
End Sub
Which works really quickly.
2. Remove items from the Nodes collection in reverse order.
I can't remember why this works quicker than standard (Microsoft did have a
document about it I think). Anyway, if you delete the nodes in reverse
order, you'll also find a speed increase (several 100% if I remember)
Good Luck
Chris Eastwood
Software Engineer
ACNielsen Ltd
Quote:
>Hi there,
>I am using the MS Tree View control (VB5 - sp3)
>This treeview can contain a large no. of nodes.
>During the loading of the information I do not want the Treeview to be
>refreshed every time. This wastes processing time.
>Is there any way , like with the MS flex grid, that you could set Redraw =
>False (or some thing allong those lines).
>Thanks in advance for your help.
>Phillip : ))
>______________________________________________
>Thanks