Private Sub Form_Load()
List1.Clear
List2.Clear
List1.AddItem "苹果"
List1.AddItem "西瓜"
List1.AddItem "草莓"
List2.AddItem "白菜"
List2.AddItem "黄瓜"
List2.AddItem "土豆"
End Sub
Private Sub Command1_Click()
Dim x As Integer, y As Integer
For x = 0 To List1.ListCount - 1
If List1.Selected(x) Then
List2.AddItem List1.List(x)
End If
Next
For y = 0 To List2.ListCount - 1
If List2.Selected(y) Then
List1.AddItem List2.List(y)
End If
Next
End Sub
就是两个列表框,单击命令按钮交换选中的东西能不能把
For x = 0 To List1.ListCount - 1
If List1.Selected(x) Then
List2.AddItem List1.List(x)
和
For y = 0 To List2.ListCount - 1
If List2.Selected(y) Then
List1.AddItem List2.List(y)
这两个句子 嵌套在一起写 该怎么写,虽然我那个也能达到目的 但感觉他们运行是不是有个先后顺序 不是同步的?
List1.Clear
List2.Clear
List1.AddItem "苹果"
List1.AddItem "西瓜"
List1.AddItem "草莓"
List2.AddItem "白菜"
List2.AddItem "黄瓜"
List2.AddItem "土豆"
End Sub
Private Sub Command1_Click()
Dim x As Integer, y As Integer
For x = 0 To List1.ListCount - 1
If List1.Selected(x) Then
List2.AddItem List1.List(x)
End If
Next
For y = 0 To List2.ListCount - 1
If List2.Selected(y) Then
List1.AddItem List2.List(y)
End If
Next
End Sub
就是两个列表框,单击命令按钮交换选中的东西能不能把
For x = 0 To List1.ListCount - 1
If List1.Selected(x) Then
List2.AddItem List1.List(x)
和
For y = 0 To List2.ListCount - 1
If List2.Selected(y) Then
List1.AddItem List2.List(y)
这两个句子 嵌套在一起写 该怎么写,虽然我那个也能达到目的 但感觉他们运行是不是有个先后顺序 不是同步的?