且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用OnPaint args将图标添加到C#中的TreeView控件

更新时间:2023-11-04 23:31:04

您必须编写OwnerDraw控件代码.除非您没有真正认真的理由,否则请避免这种情况,因为如果您想以一种很好的方式做到这一点,可能会导致非常复杂的情况.

看看这个例子.

DrawNode事件 >

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.

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