...1与列表框List2中个表项合并到List3,List1,List2原有各表项已按AS...
发布网友
发布时间:2024-10-17 21:16
我来回答
共1个回答
热心网友
时间:2024-10-17 21:55
Private Sub Command1_Click()
Dim a() As String, n As Integer
n = -1
For i = 0 To List1.ListCount - 1
n = n + 1
ReDim Preserve a(n)
a(n) = List1.List(i)
Next
For i = 0 To List2.ListCount - 1
n = n + 1
ReDim Preserve a(n)
a(n) = List2.List(i)
Next
For i = 0 To n
For j = 0 To i
If a(i) > a(j) Then
t = a(i): a(i) = a(j): a(j) = t
End If
Next
Next
For i = 0 To n
List3.AddItem a(i)
Next
End Sub