ListView 中的 ImageList
我在列表视图中有一个图像列表,以前显示的唯一图像是 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?
Thanks for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确定单击了哪个项目,当您拥有
ListViewItem
实例时,您可以检查ListViewItem.ImageIndex
属性。编辑:
ListView.SelectedItem
和/或ListView.SelectedItems
是您的朋友。Determine what item was clicked, when you then have a
ListViewItem
instance you can check for theListViewItem.ImageIndex
property.Edit:
ListView.SelectedItem
and/orListView.SelectedItems
are your friends here.