1

The behavior I'm getting:

enter image description here

The expected behavior:

enter image description here

I'm passing the parent backcolor from the main form to both the TreeView and UserControl that the treeView is inside. However, it seems like that's still not functioning.... Why do I keep getting the white borders even though the pics are PNG and has transparent background.

derloopkat
  • 6,232
  • 16
  • 38
  • 45
Bekal
  • 19
  • 1
  • The focus is on the control. If you change the focus to another object the border should go away. – jdweng Dec 22 '20 at 11:45
  • 3
    PNG supports transaprency, which also means it 'supports' anti-aliased semi-transparent pixels, which usually cause this. You need to get rid of them! See [here](https://stackoverflow.com/questions/50684959/images-in-listview-dont-match-backcolor-property/50688895#50688895) and for a helper function [here](https://stackoverflow.com/questions/43372549/remove-outline-from-image-on-transparent-form/43373628#43373628) – TaW Dec 22 '20 at 12:04

1 Answers1

1

Have you tried to alter ColorDepth property of the ImageList? This worked to me:

imageList.ColorDepth = ColorDepth.Depth32Bit;

Related Question.

Creek Drop
  • 464
  • 3
  • 13