Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Treeview Icons distorted

Treeview Icons distorted

Scheduled Pinned Locked Moved Visual Basic
helpquestion
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mbire
    wrote on last edited by
    #1

    I have a treeview and each node has an icon. At runtime, the icons are appearing with a blue border which makes result very ugly. I use the same imagelist for a listview on the same form and the icons are being rendered perfectly without the blue boarder. Is there something in the system settings or whatever settings that i need to change or be aware of to get rid of this problem? The Icon size is 16X16 (same for the original icon, imagelist setting and treeview icon size) and the color depth is 32bit (highest for my machine) Thanks for assisting.

    D 1 Reply Last reply
    0
    • M Mbire

      I have a treeview and each node has an icon. At runtime, the icons are appearing with a blue border which makes result very ugly. I use the same imagelist for a listview on the same form and the icons are being rendered perfectly without the blue boarder. Is there something in the system settings or whatever settings that i need to change or be aware of to get rid of this problem? The Icon size is 16X16 (same for the original icon, imagelist setting and treeview icon size) and the color depth is 32bit (highest for my machine) Thanks for assisting.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Do your icons have a alpha channel?? I can't seem to duplicate your problem at all and that alpha is about the only thing I haven't tried.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Do your icons have a alpha channel?? I can't seem to duplicate your problem at all and that alpha is about the only thing I haven't tried.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        M Offline
        M Offline
        Mbire
        wrote on last edited by
        #3

        Hi Dave, thanks for your efforts. The icons are standard windows shell32 icons, i actually get them from the system files. a weird thing happened yesterday, I duplicated the troublesome part of the system outside the application and it works well (icons are rendered well) but the moment i took the form back into the project, it behaved as before. Here are the 2 outputs side by side, the left one is the correct one running independently, on the right one after i add it to my windows project, with nothing changed. http://www.4shared.com/file/35005243/44721ad3/Distorted.html[^]

        D 1 Reply Last reply
        0
        • M Mbire

          Hi Dave, thanks for your efforts. The icons are standard windows shell32 icons, i actually get them from the system files. a weird thing happened yesterday, I duplicated the troublesome part of the system outside the application and it works well (icons are rendered well) but the moment i took the form back into the project, it behaved as before. Here are the 2 outputs side by side, the left one is the correct one running independently, on the right one after i add it to my windows project, with nothing changed. http://www.4shared.com/file/35005243/44721ad3/Distorted.html[^]

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          OK. The problem isn't what I was thinking of. I still didn't come up with that problem either. Is the color depth on the bad machine 32-bit?? It almost looks like 32-bit icons being rendered in 16-bit color. I'd also try updating the video drivers on the bad machine too. Hmm...

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          M 1 Reply Last reply
          0
          • D Dave Kreskowiak

            OK. The problem isn't what I was thinking of. I still didn't come up with that problem either. Is the color depth on the bad machine 32-bit?? It almost looks like 32-bit icons being rendered in 16-bit color. I'd also try updating the video drivers on the bad machine too. Hmm...

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            M Offline
            M Offline
            Mbire
            wrote on last edited by
            #5

            The shots were taken on same machine, running at the same time, i simply dragged the 2 windows side by side. I load the imagelist from the windows shell which has icons of size 32,32. the treeview is set to show a 16,16 icon size. the color depth is 32bits. (code and settings in both shots is exactly the same, the only difference is that the one in the right is wat my application is outputting and i desire wat's on the left.)

            D 1 Reply Last reply
            0
            • M Mbire

              The shots were taken on same machine, running at the same time, i simply dragged the 2 windows side by side. I load the imagelist from the windows shell which has icons of size 32,32. the treeview is set to show a 16,16 icon size. the color depth is 32bits. (code and settings in both shots is exactly the same, the only difference is that the one in the right is wat my application is outputting and i desire wat's on the left.)

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              OK. I kind-of see what you're getting at now. Ummm...A bunch of questions come to mind. 1st, how to duplicate this "outside of your project". You said that you brought the form back into the project at it started to fail again. What dod you do here? Did you create a seperate project that did the same thing and it worked as expected?? How did you get the icons from the Shell?? Are they sitting on your drive in seperate files or as resources in your app?? Did you use an ImageList setup exactly the same between the two projects??

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007

              M 1 Reply Last reply
              0
              • D Dave Kreskowiak

                OK. I kind-of see what you're getting at now. Ummm...A bunch of questions come to mind. 1st, how to duplicate this "outside of your project". You said that you brought the form back into the project at it started to fail again. What dod you do here? Did you create a seperate project that did the same thing and it worked as expected?? How did you get the icons from the Shell?? Are they sitting on your drive in seperate files or as resources in your app?? Did you use an ImageList setup exactly the same between the two projects??

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                M Offline
                M Offline
                Mbire
                wrote on last edited by
                #7

                I created a separate project, form and controls then put the code in. After it worked well, i created a new form in my application, copied and pasted the controls and also the code. The code I used is basically the same as this one. http://www.codeguru.com/vb/gen/vb_misc/icons/article.php/c5597/[^]

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups