vb中 怎样使列表框1的项目添加到列表框2中
4个回答
展开全部
Private Sub Command2_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next
End Sub 全部添加
Private Sub Command1_Click() 只添加选定的
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then List2.AddItem List1.List(i)
Next
End Sub
Private Sub Form_Load()
For i = 1 To 9
List1.AddItem i
Next
End Sub
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next
End Sub 全部添加
Private Sub Command1_Click() 只添加选定的
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then List2.AddItem List1.List(i)
Next
End Sub
Private Sub Form_Load()
For i = 1 To 9
List1.AddItem i
Next
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'前提:给窗体加个 listbox 名为:list1
Private Sub Form_Load()
Me.List1.AddItem "a"
Me.List1.AddItem "b"
Me.List1.AddItem "c"
Me.List1.AddItem "d"
Me.List1.AddItem "e"
Me.List1.AddItem "f"
Me.List1.AddItem "g"
Me.List1.AddItem "h"
Me.List1.AddItem "i"
Me.List1.AddItem "j"
Me.List1.AddItem "k"
End Sub
Private Sub List1_DblClick()
Me.List1.RemoveItem Me.List1.ListIndex
End Sub
Private Sub Form_Load()
Me.List1.AddItem "a"
Me.List1.AddItem "b"
Me.List1.AddItem "c"
Me.List1.AddItem "d"
Me.List1.AddItem "e"
Me.List1.AddItem "f"
Me.List1.AddItem "g"
Me.List1.AddItem "h"
Me.List1.AddItem "i"
Me.List1.AddItem "j"
Me.List1.AddItem "k"
End Sub
Private Sub List1_DblClick()
Me.List1.RemoveItem Me.List1.ListIndex
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
private sub command1_click
for i=0 to list1.listcount-1
list2.additem list1.list(i)
next
end sub
for i=0 to list1.listcount-1
list2.additem list1.list(i)
next
end sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
additem语句
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询