Listview子项上的图像 [英] Image on Listview Subitem
问题描述
你好亲爱的
请承认我有点沮丧.
我正试图在listview子项中显示图像/图标,就像我在Visual Basic 6和VBA上所做的一样,我不相信Visual Basic .NET还不是.我在Internet中找到了很多方法,但是在Windows API,Windows中使用了更复杂的方法 SendMenssages ...
I'm trying to show a images/Icons in listview subitem, exactly as I did on Visual Basic 6 and VBA and I don't believe Visual Basic .NET haven't it. I found a lot of ways in Internet but using more complex methods with Windows API, Windows SendMenssages...
请,我的经验告诉我应该有一个简单的方法来做到这一点.
Please, My experience tell me should exist a simple method to do it.
有人可以帮助我.
谢谢
推荐答案
你好亲爱的
请承认我有点沮丧.
我正试图在listview子项中显示图像/图标,就像我在Visual Basic 6和VBA上所做的一样,我不相信Visual Basic .NET还不是.我在Internet中找到了很多方法,但是在Windows API,Windows中使用了更复杂的方法 SendMenssages ...
I'm trying to show a images/Icons in listview subitem, exactly as I did on Visual Basic 6 and VBA and I don't believe Visual Basic .NET haven't it. I found a lot of ways in Internet but using more complex methods with Windows API, Windows SendMenssages...
请,我的经验告诉我应该有一个简单的方法来做到这一点.
Please, My experience tell me should exist a simple method to do it.
有人可以帮助我.
谢谢
您说过要显示子项目的图像吗?您是说项目吗?
You said that you want to show an image for a subitem? Do you mean item instead?
使用列表视图,实际上它们是相同的,众所周知,但是看看这个网站和Google,您会看到很多示例.
With a listview, actually they're the same, truth be known, but have a look around this site and Google and you'll see lots of examples.
I don't have any examples but you'll need an ImageList and using that, you can then reference which image to use based on the index. At least I think that's what I remember. ;-)
最后,看看文档:
https://msdn.microsoft.com/zh-CN/library/system.windows.forms.listview(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.windows.forms.listview(v=vs.110).aspx
向下滚动到您会看到备注"的位置.并对此进行了解释.
Scroll down to where you'll see "Remarks" and that explains it.
我希望这会有所帮助. :)
I hope this helps. :)
这篇关于Listview子项上的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!