Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search a treeview for a node

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi All

I have a very simple treeview (no secondary nodes) which contains all the users' usernames listed on the root level. I add the users with AddObject and the object contains the userID etc. Every 10 seconds, a timer is triggered. In this event I also want to check whether any new users have been added, so I query the database for a new list of users and looping thru the dataset I want to check each userID already has a node in the tree.

How do I step thru the tree nodes checking information in the node objects for a new user id in my dataset?

thanks for any help
lou

 
It's okay, I've done it - needed the .data bit
Code:
with formmain.tvInboxes do
  for idx := 0 to Items.count-1 do
    if pInboxRec(Items[idx].data)^.ownerID = 
                               q_UserInboxesownerID.asinteger
    then FoundUser := true;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top