ID: 293
Viewed: 2948
Added: Jul 26, 2002
Version:
Snippet uploaded by: snippet
Written By: unknown
Demo: Sorry, no demo
Thank you for your vote. Please wait...
It appears you already voted for this snippet
It appears your vote value was empty
' Very fast Clearing of treeview control - Place this where required
Highlight all by clicking in box
<!---Declaration--->
'
' 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
'
'
Highlight All
<!---Code--->
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
Do
lNodeHandle = SendMessageLong (tvHwnd, TVM_GETNEXTITEM, TVGN_ROOT, 0)
If lNodeHandle > 0 Then
SendMessageLong tvHwnd, TVM_DELETEITEM, 0, lNodeHandle
Else
Exit Do
End If
Loop
SendMessageLong tvHwnd, WM_SETREDRAW, True, 0
End Sub
;
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.