|
-
Jun 26th, 2007, 12:31 PM
#1
Thread Starter
Frenzied Member
Treeview Key not unique - any way to trap this?
Is there any way to trap if a key is not unique in a Treeview without an error? Do i have to go through all of them searching? What is you have a ton in a program such as an MP3 organizer?
Thanks!
-
Jun 26th, 2007, 12:41 PM
#2
Re: Treeview Key not unique - any way to trap this?
 Originally Posted by WarrenW
Is there any way to trap if a key is not unique in a Treeview without an error? Do i have to go through all of them searching? What is you have a ton in a program such as an MP3 organizer?
Thanks!
You can't have a duplicate key in a treeview, it will throw an error when you are loading it. You will need to trap for the error when loading it and handle the error.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Jun 27th, 2007, 10:25 AM
#3
Thread Starter
Frenzied Member
Re: Treeview Key not unique - any way to trap this?
Thanks. Is there any way to trap for this specific error? Or just use the On Error line?
-
Jun 27th, 2007, 10:27 AM
#4
Re: Treeview Key not unique - any way to trap this?
If you don't have too many nodes in the treeview then you may loop through each and check whether or not key already exist or as suggested create an Error Handler using On Error GoTo Whatever and trap that error number.
Also, you don't necessary have to assign the key at all - you may simply use node.Tag property to store some unique id or whatever text you may need to store.
-
Jun 27th, 2007, 12:13 PM
#5
Re: Treeview Key not unique - any way to trap this?
If you'd like a method for always assuring that the keys are unique to begin with then take a look at the Generate unique TreeView keys link in my signature.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|