listbox问题
Private Sub Command1_Click() '全部添加到打印项目For i = 0 To List1.ListCount - 1
List1.ListIndex = i
List2.AddItem List1.Text
Next i
List1.Clear
End Sub
Private Sub Command2_Click() '添加一条到打印项目
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
a = a + 1
End If
Next i
If a = 0 Then
MsgBox "请在左边的文本框中选择项目", , "信息提示"
Exit Sub
End If
List2.AddItem List1.Text
List1.RemoveItem List1.ListIndex
End Sub
Private Sub Command3_Click() '全部添加到基本项目
For i = 0 To List2.ListCount - 1
List2.ListIndex = i
List1.AddItem List2.Text
Next i
List2.Clear
End Sub
Private Sub Command4_Click() '添加一条到基本项目
For i = 0 To List2.ListCount - 1
If List2.Selected(i) = True Then
a = a + 1
End If
Next i
If a = 0 Then
MsgBox "请在右边的文本框中选择项目", , "信息提示"
Exit Sub
End If
List1.AddItem List2.Text
List2.RemoveItem List2.ListIndex
End Sub
这句
For i = 0 To List1.ListCount - 1
List1.ListIndex = i
List2.AddItem List1.Text
Next i
中, List1.ListIndex = i
List2.AddItem List1.Text什么意思,如何配合使用的啊