MOVENDO ITENS NO LISTBOX

GABYS 08/12/2010 17:38:45
#359131
Ola gostaria de Mover Itens no ListBox com o botao direito
como eu faço isso ??

alguem pode me ajudar
LUIZCOMINO 08/12/2010 17:46:14
#359133
é mover ou remover? se for remover


no evento MouseDown do list


Private Sub List_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button = 2 Then List1.RemoveItem (List1.ListIndex)

End sub
MARCELO.TREZE 08/12/2010 17:48:17
#359134
Resposta escolhida
assim

Private Tmp_Text As String
Private Old_index As Integer, _
New_index As Integer

Private Sub Form_Load()
For i = 1 To 10
List1.AddItem i
Next
End Sub

[ô]mouse events:
Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Old_index = List1.ListIndex
Tmp_Text = List1.Text
End Sub

Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
New_index = List1.ListIndex
If Old_index <> New_index Then
List1.RemoveItem Old_index
List1.AddItem Tmp_Text, New_index
End If
End Sub
Tópico encerrado , respostas não são mais permitidas