VB有两个列表框,假设VB列表框的左列表为List1,右列表为List2,代码如下:
Private Sub Command1_Click()
List2.AddItem List1.Text
List1.RemoveItem (Selected)
End Sub
Private Sub Command2_Click()
List1.AddItem List2.Text
List2.RemoveItem (Selected)
End Sub
Private Sub Form_Load()
Command1.Caption = ">>>>"
Command1.Enabled = False
Command2.Caption = "Command2.Enabled = False
End Sub
Private Sub List1_Click()
Command1.Enabled = True
Command2.Enabled = False
End Sub
Private Sub List2_Click()
Command2.Enabled = True
Command1.Enabled = False
End Sub