Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2001, 10:48 PM
Storm Storm is offline
Senior Member
 
Join Date: Jan 2001
Posts: 837
Default Still need help with a treeview searching thing

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
Reply With Quote
  #2  
Old 04-17-2001, 11:03 PM
PoseFant PoseFant is offline
Senior Member
 
Join Date: Jan 2001
Posts: 1,002
Default RE: Still need help with a treeview searching thing

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
Reply With Quote
  #3  
Old 04-18-2001, 06:50 PM
Storm Storm is offline
Senior Member
 
Join Date: Jan 2001
Posts: 837
Default RE: RE: Still need help with a treeview searching thing

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.