[英]How can i draw an image in the listbox along with the listboxItem [c# winforms]
(我正在使用c#在Winforms中工作)我有一个列表框,其中添加了一些项目。我的问题是我想在列表框中每个项目的左侧绘制图像。有人可以提出任何想法吗? 提前致谢。
我可以使用ImageList做到这一点。
imageList.Draw(ea.Graphics, bounds.Left, bounds.Top,item.ImageIndex);
但我想这样使用
ea.Graphics.DrawImage("someImage",new point);
为此,您应该使用列表视图控件而不是列表框。 listview本机支持imagelist绑定,并且listviewitem具有imageindex属性,因此您可以指定要从imagelist呈现的图像的索引。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.