列表框(List)如何调换顺序!
我想通过点击一个按钮来如列表框中的文件就上移一个,请问各位高手,如何来实现,谢谢了!
问题点数:20、回复次数:4Top
1 楼chenlishu413(超級學生)回复于 2003-06-01 08:42:18 得分 0
改變listindexTop
2 楼footballboy(郑创斌)回复于 2003-06-01 09:18:55 得分 0
列表框中的文件就上移一个? 是不是指列表框中的某个列表项位置前移?如果是这样,还需要考虑以下问题:1.是否需要考虑多选的情况;2.表项移至最顶部时的处理Top
3 楼footballboy(郑创斌)回复于 2003-06-01 09:38:09 得分 20
不考虑多选的情况
Private Sub Command2_Click()
Dim i As Long
Dim temp As String
If List1.ListIndex > 0 Then
temp = List1.List(List1.ListIndex - 1)
List1.List(List1.ListIndex - 1) = List1.List(List1.ListIndex)
List1.List(List1.ListIndex) = temp
List1.Selected(List1.ListIndex - 1) = True
Else
MsgBox "已移至最顶"
End If
End Sub
Top
4 楼tzbxf(netfan)回复于 2003-06-21 18:56:09 得分 0
谢谢了!Top




