Sub List1_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Static SecondClick As Integer
Static DropText As String
Dim RowHeight As Single
Dim TopI As Integer, InsertI As Single
TopI = SendMessage(List1.hWnd, LB_GETTOPINDEX, 0&, 0&)
RowHeight = TextHeight("X")
InsertI = Y \ RowHeight
If Button = 2 And DropText = "" And SecondClick = False Then
List1.ListIndex = InsertI + TopI
DropText = List1.Text
MousePointer = 10
SecondClick = True
List1.RemoveItem InsertI + TopI
ElseIf Button = 2 And Len(DropText) > 2 And SecondClick = True Then
If InsertI + TopI < List1.ListCount - 1 Then
List1.AddItem DropText, InsertI + TopI
Else
List1.AddItem DropText, InsertI + TopI + 1
End If
DropText = ""
SecondClick = False
MousePointer = 0
End If
End Sub