Question Print tree node automatically and print out the treeview(my homework,please help^^))

bennettfan

Member
Joined
Jan 31, 2010
Messages
11
Programming Experience
Beginner
treeye.jpg

Here is my array and I would like to ask how can I display the Tree node automatically.

That is, once I click the bottom, the tree node will show as below.
tree2r.jpg


Also, I would to ask how can I print this tree in a A4 paper? What code I can use?

Please help, this is my final year project. Thanks you very much^^....
If you have any question about my project, please feel free to ask...
 
The following code is used when a tree node is being selected, then the child of that node will be printed.

and now, I just want to print those node automatically but not click the buttom lots of time. Thanks for your help^^

Dim show As Boolean = True
Dim no As Integer = 0
Dim i As Integer = 1


If (tvwLanguages.SelectedNode Is Nothing) Then
MsgBox("Please select a node to display!")
End If

If (tvwLanguages.SelectedNode.Checked = True) Then
MsgBox("Generation has been added!")
GoTo Finish
End If


While (displayArray(no, 0) <> Nothing)
show = StrComp("TreeNode: " + displayArray(no, 0), tvwLanguages.SelectedNode.ToString)

If (show = False) Then
tvwLanguages.SelectedNode.Checked = True
GoTo Print
End If

no = no + 1
End While


Print: While (displayArray(no, i) <> Nothing)

tvwLanguages.SelectedNode.Nodes.Add(displayArray(no, i))
i = i + 1

End While

tvwLanguages.SelectedNode.Expand()
Finish:
 
Back
Top