![]() |
|
|
|
#1
|
|||
|
|||
|
hello all
so i have a question about searching for a text in a treeview... problem is: i have on my mainform a listbox on the left and a treeview on the right containing informations of files like this: Treeview: CD NAME August 1999 1#2 ..Coding Tips ..Tuturial 1 ..Tuturial 2 and so on..when i press on a special button on my form the contest of Coding Tips will be exported to the Listbox without CD NAME without CODING TIPS... thats how it should work but for my problem if the listbox contains those names like Tuturial 1 and Tuturial 2 how can i display in an Editbox while clicking on an Item in the Listbox from which CD NAME (CD NAME August 1999 1#2) the Item (Tuturial 1) comes from?? wow hard to describe for further information i would like to email you if you have any questions about that what i am trying to do... many thanx for all replies |
|
#2
|
|||
|
|||
|
You have to store this information somewhere ...
Because ... The indexing of parentnodes goes from 0 to n The indexing of childnodes goes from 0 to n TreeView.Selected.Index will give you the corresponding index in the previous architecture. Lets say that we indexed all nodes from 0 to n from top to bottom ... (Only hypothetical) TreeView.Selected.AbsoluteIndex will give you the index in the previous architecture. So ... the conclusion ... With these two indexing results you will be able to do some simple math to find the index of the parent node. When you have your parent node index it is a small piece of code to get the correct text. TreeView.Items.Item[AbsoluteIndex].Text Regards /Filip |
|
#3
|
|||
|
|||
|
hi there thankyou for your answer well seems to be not very eayse to get the information i need...
i would like to asked you if you have an example for me because of the things you told me????? if it's possible? it would be very nice i need really help of those stuff thank you very much |
![]() |
| Thread Tools | |
| Display Modes | |
|
|