Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Treeview
Message
 
To
06/10/2004 05:27:38
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00949070
Message ID:
00949076
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>How can I do to select all of the children of a node ?
>What I want to do is to check or uncheck all of the related nodes of a node by checking or unchecking the parent.
>Is it possible to mark in a grey forecolor the check box of a Node whose children are partially checked ?
>Thank you.
>Alessio


Alessio Add a method in the form named NodeCheck & put this code in it:
LPARAMETERS oNode
WITH oNode
     m_chk = .Checked
     IF TYPE("oNode.Child") == "O" .AND. .NOT. ISNULL(.Child)
        .Child.Checked = m_chk
        IF .Child.Children # 0
           this.NodeCheck(.Child)
        ENDIF
        n = .Child.Index
        DO WHILE n # .Child.LastSibling.Index
           WITH this.oleTree.Nodes(n) && Put the Real Name of the TreeView
                IF TYPE(".Next") == "O" .AND.;
                   .NOT. ISNULL(.Next)
                   .Next.Checked = m_chk
                   IF .Next.Children # 0
                      this.NodeCheck(.Next)
                   ENDIF
                   n = .Next.Index
                ELSE
                   EXIT
                ENDIF
            ENDWITH
         ENDDO
     ENDIF
ENDWITH

**** In NodeCheck Event of the TreeView
LPARAMETERS node
thisform.NodeCheck(node)
This select or disselect all the child nodes of the parent node.

About second question, sorry I can't help :o(((
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform