Thank you Cathi, That'll work fine!
***** SAMPLE
You will need to create an up button and a down button as well as create a field named _moving.
Private Sub lstSample_SelectedIndexChanged(sender As Object, e As System.EventArgs)
If _moving Then
Return
End If
Dim au As Author = CType(lstSample.SelectedItem, Author)
MessageBox.Show(Me, String.Format("Name: {0}" + ControlChars.Lf + "ID: {1}", au.ToString(), au.ID), "Choice")
End Sub 'lstSample_SelectedIndexChanged
Private Sub btnUp_Click(sender As Object, e As System.EventArgs)
_moving = True
Dim i As Integer = lstSample.SelectedIndex
Dim au As Author = CType(lstSample.SelectedItem, Author)
lstSample.Items.RemoveAt(i)
lstSample.Items.Insert(i - 1, au)
lstSample.SelectedIndex = i - 1
_moving = False
End Sub 'btnUp_Click
Private Sub btnDn_Click(sender As Object, e As System.EventArgs)
_moving = True
Dim i As Integer = lstSample.SelectedIndex
Dim au As Author = CType(lstSample.SelectedItem, Author)
lstSample.Items.RemoveAt(i)
lstSample.Items.Insert(i + 1, au)
lstSample.SelectedIndex = i + 1
_moving = False
End Sub 'btnDn_Click
***** END SAMPLE
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only