-
Feb 19th, 2003, 11:10 AM
#1
Thread Starter
Frenzied Member
Initialize An Image List [TreeView Error] (Resolved)
hey ya,
I'm using a tree view to show a returned username & chat room to a person's search from my chat server,
and add the items like:
VB Code:
' Add the user name to the list
Dim n As Variant
Set n = tvRes.Nodes.Add(, , , SplitArr(0), imgLst.ListImages(1).Picture)
' Add the users location to the list view
If InStr(SplitArr(1), "PRIVATE ") Then
tvRes.Nodes.Add n, tvwChild, , "(Private)", imgLst.ListImages(2).Picture
Else
tvRes.Nodes.Add n, tvwChild, , SplitArr(1)
End If
TreeView = "tvRes"
Username = "splitArr(0)"
Room = "SplitArr(1)"
only, i get the following error, and don't understand why?
---------------------------
The Walks Chat
---------------------------
Error 35613: ImageList must be initialized before it can be used
---------------------------
OK
---------------------------
how do i initialize the image list? [is this the image list for the imgLst or for TreeView.ImageList?
Last edited by wpearsall; Feb 19th, 2003 at 05:14 PM.
Wayne
-
Feb 19th, 2003, 12:59 PM
#2
Fanatic Member
You have to associate the tree view with the ImageList.
So the treeview control I believe has an .ImageList property, you need to Set it to the ImageList Control.
VB Code:
Set Treeview.ImageList=ImageList
Or try MSDN at this link
http://msdn.microsoft.com/library/de...jImageList.asp
-
Feb 19th, 2003, 03:04 PM
#3
Thread Starter
Frenzied Member
so, in my form load event, i added
VB Code:
set tvRes.ImageList = imgLst
and then when it gets the line to add the item's to the t/v, it is now saying
---------------------------
The Walks Chat
---------------------------
Error 35603: Invalid key
---------------------------
OK
---------------------------
and is pointing to the image? :shrugs: i dunno why, but this seams to b pretty weird.
does any one have an example i could use? or something ?
-
Feb 19th, 2003, 04:29 PM
#4
The Image parameter of the Nodes.Add method expects either the Index or the Key of the image, not the picture.
tvRes.Nodes.Add n, tvwChild, , "(Private)", 1
or
tvRes.Nodes.Add n, tvwChild, , "(Private)", "PrivateIcon"
-
Feb 19th, 2003, 05:13 PM
#5
Thread Starter
Frenzied Member
thank's! got it
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
|