Guest Posted April 12, 2011 Posted April 12, 2011 Message from: "bettersoft" var iLen, ii, image: integer; begin image:=1; iLen: = UniTreeView1.Items.Count; for ii: = 1 to iLen do begin EmrUniTreeView.Items [ii-1]. ImageIndex: = image; end; end; The TreeView 5 layer nodes, a total of more than 2,000 nodes. All traverse a node is very slow, to 10 minutes, I just change the node icon. Traversal methods are no good? In Vcl in quickly. And traversal, all nodes must be Expanded = True. Otherwise it will error. . Quote
Guest Posted April 14, 2011 Author Posted April 14, 2011 Message from: "Farshad Mohajeri" Tree with 2000 nodes? Seems lots of subnodes are there. It is better to assign the ImageIndex just after you create the node. I will test and try to improve the speed. "bettersoft" wrote in message news:%23S98jDO%23LHA.1984@anaxagvs227... > var iLen, ii, image: integer; > begin > image:=1; > iLen: = UniTreeView1.Items.Count; > for ii: = 1 to iLen do > begin > EmrUniTreeView.Items [ii-1]. ImageIndex: = image; > end; > end; > > The TreeView 5 layer nodes, a total of more than 2,000 nodes. All traverse > a node is very slow, to 10 minutes, I just change the node icon. Traversal > methods are no good? In Vcl in quickly. > And traversal, all nodes must be Expanded = True. Otherwise it will error. > . Quote
Guest Posted April 15, 2011 Author Posted April 15, 2011 Message from: "bettersoft" In the Vcl, delphi own TreeView, TreeView1.item.Count, should be the first stage the number of nodes. However, the number of nodes uniTreeview.items.Count all. So a traversal is very troublesome. If I want to be first-level node traversal, we must traverse all the nodes, and then look unitreeview.Level = 0 nodes. If the traversal process, the need to modify the imageindex, very slow, and the system sometimes error, can all nodes must be expanded = True? but when expanded = Ture, modify imageindex sometimes error. . Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.