Solved

search/find treeviewitem when only item label is known

Posted on 2003-10-22
7
563 Views
Last Modified: 2013-12-26
hi
I know the label(text) of a treeview item. how can i access that particular treeviewitem(all items populated from database) and change its properties(like make it bold).
thanks in advance
0
Comment
Question by:balakarthikeyan
  • 2
  • 2
7 Comments
 
LVL 2

Expert Comment

by:bluecomet
ID: 9597502
HI,

if your labels are unique it is simple. Go trough the hole treeview to pick your item an than you can use getitem and setitem with his itemhandle to change your item.
if your labels aren't unique you must go trought the hole treeview and check the data of your item to change it. Data must be unique.

or

when you click on an item you have his handle and you can get change it as mentioned above.

$regards
0
 

Author Comment

by:balakarthikeyan
ID: 9597678
hello
what you have told is the logic which i readily agree upon but the thing is i need the code. my application uses this treeview control to populate data(window titles) at runtime. on selecting a window title(treeviewitem) in the treeview i open the corresponding window in the mdi client area and make the treeviewitem name bold. I may have many windows open at a time.Now when i close any window, the windowname in the treeview should have the 'bold' face changed to regular.Hope you understand .So as you said can i loop thro the treeview and find a particular label .If so pls send me the code. thanks
0
 
LVL 2

Accepted Solution

by:
bluecomet earned 20 total points
ID: 9598557
If i understand well what you will do do the following:

declare an instance variable in each window which you call il_tv_handle which will contain the itemhandle of the label in your treeview of a window.
so when you click on an item in your treeview you will open the window and save the value.

event treeview.click()

 open(window_name)
 window_name.il_tv_handle = handle

----

on closequery of an opened window which will be closed do:

treeviewitem ltv_item

w_tv.tv.getitm(il_tv_handle,ltv_item)
ltv_item.bold = false
w_tv.tv.setitm(il_tv_handle,ltv_item)

hopes that is what you want

$regards
0
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 9598566
hi,

i think there is no any such property for individual treeview items. the properties that you can use for the same stuff are picturename and statepicturename. Using it u will be able to identify which items currently user has selected.

-sandeep
0
 

Author Comment

by:balakarthikeyan
ID: 9604431
hi Bluecomet
      You were close to the answer.Having instance variables is ok.Your closequery event code is also right. But you cannot assign the handle to the instance variable using the method you have specified.ie window_name.instancevar = handle
This will return an "incompatible property for window" error.
Sorry yaar! And thanks for your valuable comments

hi sandeep_patel
   Your idea will definitely not work out. Anyway thanks for the response. Better luck next time

Dear Administrator
I think you can give partial points for bluecomet say 20 points. I have found the solution myself  by starting out from bluecomet's comments.Kindly close this thread and give me the remaining points.

regards
balakarthikeyan
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now