Added: Jul 26, 2002
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo
' Very fast Clearing of treeview control - Place this where required
Highlight all by clicking in box
' Constants / Declarations - Change Public / Private as required
Public Const TV_FIRST As Long = &H1100
Public Const TVM_GETNEXTITEM As Long = (TV_FIRST + 10)
Public Const TVM_DELETEITEM As Long = (TV_FIRST + 1)
Public Const TVGN_ROOT As Long = &H0
Public Const WM_SETREDRAW As Long = &HB
Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Sub ClearTreeView(ByVal tvHwnd As Long)
Dim lNodeHandle As Long
' Turn off redrawing on the Treeview for more speed improvements
SendMessageLong tvHwnd, WM_SETREDRAW, False, 0
lNodeHandle = SendMessageLong (tvHwnd, TVM_GETNEXTITEM, TVGN_ROOT, 0)
If lNodeHandle > 0 Then
SendMessageLong tvHwnd, TVM_DELETEITEM, 0, lNodeHandle
SendMessageLong tvHwnd, WM_SETREDRAW, True, 0
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.