Runtime Error '35613' Imagelist must initialized before it can be
Last edited by wiz126; Sep 30th, 2005 at 09:31 PM.
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
You need to assign the image list to your listview. Right-click on your listview and select properties, click on the Image Lists tab and fill in the missing info.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT
Replace all your code with this code. Then set the custom property of the listview's Normal Imagelist to your imagelist. And thats it.
You didnt assign an imagelist to the listview and you were setting the large icon property and not the small icon property.
VB Code:
Option Explicit
Private Sub Form_Load()
With ListView1
.OLEDragMode = 1
.View = lvwSmallIcon
.SmallIcons = ImageList1
End With
ListView1.ListItems.Add , , "TEST1", , 2
ListView1.ListItems.Add , , "TEST2", , 1
ListView1.ListItems.Add , , "TEST3", , 2
ListView1.ListItems.Add , , "TEST4", , 1
ListView1.ListItems.Add , , "TEST4", , 2
ListView1.ListItems.Add , , "TEST4", , 1
ListView1.ListItems.Add , , "TEST4", , 2
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
oh i see so i using the wrong section to post my picture in the code
not
, 1
, , 1
such a stupid misstype of me, how stupid
1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
2) If someone has been useful to you please show your respect by rating their posts.
3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
4) Before posting your question, make sure you checked this links: MICROSOFT MSDN -- VB FORUMS SEARCH
5)Support Classic VB - A PETITION TO MICROSOFT