View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
What-a-Tool What-a-Tool is offline
external usenet poster
 
Posts: 14
Default ImageList must be initialized

Yeah - I have a form, I have a treview on it, I have an image list on it ,
and I've got the names straight.
I have my tree view working just fine, thank you. This friggin image list is
drivin me nuts, though.

With Me.tvwMain
Set .ImageList = ilstMain
Set tn = .Nodes.Add(, , strSWDefaultFolder, strFolder, 1, 2)
End With

If I put the Me identifier in front of ilstMain, I get an Invalid Object
error.
If I test as is, I get an "imagelist must be initialized" error

--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"keepITcool" wrote in message
...


If you cant solve THAT ..
it may be best to forget using a treeview.,
as I seriously doubt you're going to be able to fill it,
and write proper handling code for the results.


I assumed:
you have a userform..
uf has 1 treeview
uf has 1 imagelist

iml has 2 images (16X16 256 bitmaps or icons)



Private Sub UserForm_Initialize()
With Me.TreeView1
.ImageList = Me.ImageList1
.Nodes.Add , , "key1", "text1", 1
.Nodes.Add , , "key2", "text2", 2
End With
End Sub



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"What-a-Tool" wrote:

Set Me.TreeView1.ImageList = Me.ImageList1 :gives an error "Invalid
object"