你是指内容上移吗?如:上移:
With List1
If .ListIndex >= 0 Then
ab = .List(.ListIndex - 1)
.List(.ListIndex - 1) = .List(.ListIndex)
.List(.ListIndex) = ab
End If
End With
With List1
If .ListIndex >= 0 Then
ab = .List(.ListIndex - 1)
.List(.ListIndex - 1) = .List(.ListIndex)
.List(.ListIndex) = ab
End If
End With
'上移
If List1.ListIndex = -1 Then
MsgBox "请选中listbox中的一项"
End If
If List1.ListIndex > 0 Then
strMid = List1.List(List1.ListIndex - 1)
List1.List(List1.ListIndex - 1) = List1.List(List1.ListIndex)
List1.List(List1.ListIndex) = strMid
List1.ListIndex = List1.ListIndex - 1
End If
End Sub
Private Sub cmdDown_Click()
'下移
If List1.ListIndex = -1 Then
MsgBox "请选中listbox中的一项"
End If
If List1.ListIndex < List1.ListCount - 1 Then
strMid = List1.List(List1.ListIndex + 1)
List1.List(List1.ListIndex + 1) = List1.List(List1.ListIndex)
List1.List(List1.ListIndex) = strMid
List1.ListIndex = List1.ListIndex + 1
End If
End Sub----
by Henry