If Me.ListBox1.SelectedIndex = -1 Then Exit Sub
Dim _i As Integer = ListBox1.SelectedIndex
If ListBox1.SelectedIndex > 0 Then
Me.ListBox1.Items.Insert(ListBox1.SelectedIndex - 1, Me.ListBox1.SelectedItem)
Me.ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
Me.ListBox1.SetSelected(_i - 1, True)
End If
--Downd Code (VB.NET)
If Me.ListBox1.SelectedIndex = -1 Then Exit Sub
Dim _i As Integer = ListBox1.SelectedIndex
If ListBox1.SelectedIndex < Me.ListBox1.Items.Count - 1 Then
Me.ListBox1.Items.Insert(ListBox1.SelectedIndex + 2, Me.ListBox1.SelectedItem)
Me.ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
Me.ListBox1.SetSelected(_i + 1, True)
End If