اولآ صرح عن متغير من نوع Integer واعطي هذا المتغير قيمة العنصر المحذوف في القائمة
كود :
Public n As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
n = Me.ListView1.FocusedItem.Index
End Subكود :
ListView1.Focus()
Try
Form1.ListView1.Items(Form1.n).Selected = True
Catch ex As Exception
Form1.ListView1.Items(Form1.n - 1).Selected = True
End Try
