Search code examples
c#treeviewonpaint

How to add icons to TreeView control in c# using OnPaint args


How to add icons to TreeView control in c# WITHOUT the ImageList control? I think you need tp call the OnPaint event args but no idea how to do it.


Solution

  • Yo have to code OwnerDraw control. Unless you have not really serious reasons, avoid this, as this can turn out into very complicated scenarios, if you want to do it in a good way.

    Have a look on this example.

    DrawNode event