Results 1 to 7 of 7
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Trreview Imagelist (XP/2000)

    Right-click the TreeView control and select TreeCtrl Object | Properties. This will display a properties dialog specific to the treeview control; you can set the ImageList property here.

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Trreview Imagelist (XP/2000)

    That's great Hans, thanks.

    Is it possible to set it in code though?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Treeview Imagelist (XP/2000)

    I'm trying to add images to a treeview but when I try to assign the imagelist property to the treeview (in code) to the imagelist on my form I get an error 'object not found.'

    Just had a look at the property sheet for the treeview and can't see a property called 'imagelist' - what am I missing? This is driving me crazy

    ps. I'm using MSComctlLib.TreeCtrl.2 and MSComctlLib.TreeCtrl.2

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Trreview Imagelist (XP/2000)

    Yes, like this:

    Set Me.TreeView1.ImageList = Me.ImageList1

    where TreeView1 and ImageList1 are the names of the controls. (Since a control is an object, you must use Set to assign the ImageList property)

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Trreview Imagelist (XP/2000)

    Odd, I get the the same error

    35602 Invalid object

    As when I wasn't using the word 'set'

    Set Me.tvwDataHierarchy.ImageList = Me.imgListForTreeview

    But its quite happy to have it set from the properties sheet.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Trreview Imagelist (XP/2000)

    Try

    Set Me.tvwDataHierarchy.ImageList = Me.imgListForTreeview.Object

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Trreview Imagelist (XP/2000)

    It worked!

    Thanks again <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •