Not a Member Yet,
Click here to Register

ID: 291
Viewed: 2859
Added: Jul 26, 2002
Version:
Snippet uploaded by: snippet
Written By: gdebacker
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

to have check box next to teh parent node and you check it, it will check all teh childs too.


Highlight all by clicking in box
<!---Declaration--->
none

Highlight All
<!---Code--->
Public Sub CheckNodes(MyTreeView As TreeView, ByVal Node As MSComctlLib.Node, bChecked As Boolean) 
Dim iIndex As Integer
If Not Node Is Nothing Then
If Node.Children > 0 Then
iIndex = Node.Child.Index
Node.Child.Checked = bChecked
CheckNodes MyTreeView, Node.Child, bChecked
While iIndex <> Node.Child.LastSibling.Index
MyTreeView.Nodes(iIndex).Next.Checked = bChecked
iIndex = MyTreeView.Nodes(iIndex).Next.Index
CheckNodes MyTreeView, MyTreeView.Nodes(iIndex).Next, bChecked
Wend
CheckNodes MyTreeView, Node.Child.Next, bChecked
Else
Node.Checked = bChecked
End If
End If
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.


Replying to a Comment...


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.

© 2002 - 2024 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!