Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make primary child of treeview non-clickable to text area? 1

Status
Not open for further replies.

ixian

Programmer
Jul 13, 2001
128
US
Hi all,

Just asking about this issue:
I wish for only the issues in the sub areas of information to be transferred to the text area of the main form?
Do I make them all grandchild nodes or what?

Aaron

sample code

private sub form_load()
Dim nodx as Node
Set nodx = tvwxxx.Nodes.Add(, , "How", "How to do.....")
nodx.EnsureVisible
Set nodx = tvwxxx.Nodes.Add("How", tvwchild, "ASP", "ASP code")
Set nodx = tvwxxx.Nodes.Add("ASP", tvwchild, "ASP1", "XML")
Set nodx = tvwxxx.Nodes.Add("ASP", tvwchild, "ASP2", "ActiveX objects")
Set nodx = tvwxxx.Nodes.Add("How", tvwchild, "HTML", "HTML code")
Set nodx = tvwxxx.Nodes.Add("HTML", tvwchild, "HTML1", "images/photos")
Set nodx = tvwxxx.Nodes.Add("HTML", tvwchild, "HTML2", "links")
End Sub

Private Sub tvwxxx_NodeClick(ByVal Node as Node)
frmMain.txtHelp.Text = frmMain.txtHelp.Text & node.Text &vbCrLf
End Sub

 
Try this...

Code:
Private Sub form_load()
Dim nodx As Node
Set nodx = tvwxxx.Nodes.Add(, , "How", "How to do.....")
nodx.EnsureVisible
Set nodx = tvwxxx.Nodes.Add("How", tvwchild, "ASP", "ASP code")
Set nodx = tvwxxx.Nodes.Add("ASP", tvwchild, "ASP1", "XML")
Set nodx = tvwxxx.Nodes.Add("ASP", tvwchild, "ASP2", "ActiveX objects")
Set nodx = tvwxxx.Nodes.Add("How", tvwchild, "HTML", "HTML code")
Set nodx = tvwxxx.Nodes.Add("HTML", tvwchild, "HTML1", "images/photos")
Set nodx = tvwxxx.Nodes.Add("HTML", tvwchild, "HTML2", "links")
End Sub

Private Sub tvwxxx_NodeClick(ByVal Node As Node)
    Dim n As Node
    Dim t As String
    
    t = ""
    Set n = Node
    While TypeName(n) = "INode"
        t = t & ">-" & Reverse(n.Text)
        Set n = n.Parent
    Wend
    
    txtHelp.Text = Reverse(Mid(t, 3))
End Sub

Private Function Reverse(s1) As String
    Dim i As Long
    For i = Len(s1) To 1 Step -1
        Reverse = Reverse & Mid(s1, i, 1)
    Next
End Function

Chaz
 
Actually, on further reading, I think I've got the problem wrong.

Could you please clarify what you are after?

Chaz
 
Im want only the

Set nodx = tvwxxx.Nodes.Add("ASP", tvwchild, "ASP1", "XML")
Set nodx = tvwxxx.Nodes.Add("ASP", tvwchild, "ASP2", "ActiveX objects")
or
Set nodx = tvwxxx.Nodes.Add("HTML", tvwchild, "HTML1", "images/photos")
Set nodx = tvwxxx.Nodes.Add("HTML", tvwchild, "HTML2", "links")

to the text area not the ASP code or HTML code part

Aaron
 
Do I code it as such

If node = "ASP"/"HTML" then DisableClick????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top