ImageList in a ListView

半世苍凉 提交于 2019-12-11 06:18:32

问题


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


回答1:


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

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



来源:https://stackoverflow.com/questions/6370195/imagelist-in-a-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!