I am not very familiar with C# but i think you could interpret this VB.NET Code. You need to do some math to figure out the difference between the two index's
Public OldIndex As String
Public NewIndex As String
Public FinalIndex As String
Public ItemNumber As Integer
Know you only need to calculate the new index when you search it. So when you search it put this in your code.
OldIndex=ListView1.Index
NewIndex=ListView1.Index
FinalIndex=NewIndex-OldIndex
If FinalIndex < 0 Then
FinalIndex=FinalIndex*-1
ItemNumber=12 + FinalIndex
ElseIf FinalIndex > 0 Then
FinalIndex= 12 - FinalIndex
End If
Their you go you should replace your code with this in the listView1_MouseDoubleClick
private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (listView1.Items[ItemNumber].Selected)
{
MessageBox.Show("Test");
}
}
Hope this helps if it does not please don't complain, I tried my best :)