Get index of a selected item in a list view
So, how to get an index of a clicked element in a scroll viewer?
Or a clicked element in a scroll view?
I need it, to be able to open a dialog menu with file selection and change the clicked/selected image
Code:
https://hastebin.skyra.pw/ulupiyirez.ts
(Pic1)
This is how it looks in the app
Upd: WPF
1 Reply
I'm not sure, but I think you need to get the index from The ListView, not the Scrollviewer. If you were using a ListView > GridView, you'd get the index from the GridView.
Try reading this:
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.listview.selecteditems?view=windowsdesktop-8.0
ListView.SelectedItems Property (System.Windows.Forms)
Gets the items that are selected in the control.