ImageList中在ListView [英] ImageList in a ListView

查看:184
本文介绍了ImageList中在ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表视图,其中previously显示的唯一图像是PDF格式的图像列表。这意味着,我可以有效地处理双击事件来打开PDF文件。现在,我有不同的要求,一个文件夹中显示其他文件的一些占位符缩略图。有没有在事件listView_DoubleClick的方式确定单击图像列表中的图片是什么,这样我可以决定如何处理该事件?

I have an image list in a list view where previously the only images displayed were pdf's. This meant that that i could handle the double click event effectively to open pdf's. Now i have a different requirement to display some place holder thumbnails for other files in a folder. Is there a way in the listView_DoubleClick event to determine what picture was clicked in the image list, that way i can determine how to handle the event?

感谢您的时间

推荐答案

确定到底点击了哪个项目,当你再有一个 ListViewItem的比如,你可以检查 ListViewItem.ImageIndex 属性。

Determine what item was clicked, when you then have a ListViewItem instance you can check for the ListViewItem.ImageIndex property.

编辑:
ListView.SelectedItem 和/或 ListView.SelectedItems 在这里你的朋友。

ListView.SelectedItem and/or ListView.SelectedItems are your friends here.

这篇关于ImageList中在ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆