Private Sub cmdMove_Click()
'init
Dim i As Integer

'move selected item to other list
If List1.SelCount Then
'...move item from list1 to list2
i = List1.ListIndex
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex

'...if list1 is now empty, exit sub
If List1.ListCount = 0 Then
List2.SetFocus
cmdMove.Caption = "< Move"
Exit Sub
End If

'...reset the focus
List1.SetFocus
If i < List1.ListCount Then
List1.ListIndex = i
Else
List1.ListIndex = List1.ListCount - 1
End If

文件列表:

fMoveList.frm

fMoveList.frx

List2List.vbp

List2List.vbw
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。