Results 1 to 5 of 5

Thread: Changing Treeview Icons

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Question

    Hi,
    If had a treeview and an imagelist on the same form. If I had previously loaded the treeview with all the icons and everything, is it possible for me to go back and Change (not add) the icon for a specific node at runtime without having to reload the treeview?

    Keep in mind that I already know the name of the node that I want to change.

    Thanks

    [Edited by omarswan on 04-25-2000 at 06:07 AM]
    Omar
    [email protected]
    http://omar.caribwalk.com
    To God Be The Glory

    I see Tech People ...

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658

    Smile Treeview Image

    You can indeed change the images and it is quite simple.

    Code:
    'imageNumber is the index of the image in the image list.
    TreeView1.Nodes("myNode").Image = imageNumber
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Question What if the Imagelist is not connected to the Treeview?

    What if the Imagelist is not connected to the Treeview?

    Or How can I change The Form Icon and replace it with an icon in the imagelist?
    Omar
    [email protected]
    http://omar.caribwalk.com
    To God Be The Glory

    I see Tech People ...

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    To change the icon of the Form to an image in an Image List you can do.

    Code:
      'myImage is the index number of the image you wish to use
      Me.Icon = ImageList1.ListImages(myImage).Picture
    I am not completly sure about this, but i think you have to have an imageList bound to a treeview if you want any images. I have tried setting an image without an image list bound to the treeview and i kept getting an error. So i am afraid i can't help any more than this.

    Iain, thats with an i by the way!

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Smile Thanks Iain17 For Your Help

    I Found Out How To Do It

    'Change Form Icon
    Me.Icon = ImageList2.ListImages(2).Picture

    'Change Node Image At Runtime
    TreeView.Nodes("NODE_NAME").Image = ImageList2.ListImages(3).Index

    Thanks Again
    Omar
    [email protected]
    http://omar.caribwalk.com
    To God Be The Glory

    I see Tech People ...

Posting Permissions

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



Click Here to Expand Forum to Full Width