VB中istbox 怎么在点击按钮时另外一个listbox2中的内容转移到lisbox1
1个回答
展开全部
Private Sub Command5_Click() If List1.ListIndex >= 0 Then List2.AddItem List1.Text If List1.Selected(List1.ListIndex) Then List1.RemoveItem List1.ListIndex If List1.ListCount = 0 Then Command5.Enabled = False Else List1.ListIndex = 0 End If End If End If If Command6.Enabled = False Then Command6.Enabled = True End IfEnd SubPrivate Sub Command6_Click() If List2.ListIndex >= 0 Then List1.AddItem List2.Text If List2.Selected(List2.ListIndex) Then List2.RemoveItem List2.ListIndex If List2.ListCount = 0 Then Command6.Enabled = False Else List2.ListIndex = 0 End If End If End If If Command5.Enabled = False Then Command5.Enabled = True End IfEnd Sub 2个按钮和2个listbox互相添加和删除内容
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询