vb 单击一个按钮 列表框中内容全部到另个列表框
2个回答
展开全部
希望下面代码能完成你要的效果.如果楼主还不能满意的话...请再说明白一点...
'需要控件:list1,list2,command1
Private Sub Command1_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next i
End Sub
Private Sub Form_Load()
List1.AddItem "北京"
List1.AddItem "上海"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
End Sub
'需要控件:list1,list2,command1
Private Sub Command1_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next i
End Sub
Private Sub Form_Load()
List1.AddItem "北京"
List1.AddItem "上海"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
End Sub
展开全部
上楼的list1还未清空呀
Private Sub Command1_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next i
for j= 0 to List1.ListCount-1
list1.RemoveItem List1.List(j)
Next j
End Sub
Private Sub Form_Load()
List1.AddItem "北京"
List1.AddItem "上海"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
End Sub
Private Sub Command1_Click()
For i = 0 To List1.ListCount - 1
List2.AddItem List1.List(i)
Next i
for j= 0 to List1.ListCount-1
list1.RemoveItem List1.List(j)
Next j
End Sub
Private Sub Form_Load()
List1.AddItem "北京"
List1.AddItem "上海"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
List1.AddItem "天津"
List1.AddItem "重庆"
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询