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)
Private Sub Form_Load()
Command1.Caption = ">>>>"
Command1.Enabled = False
Command2.Caption = "
Command2.Enabled = False
Private Sub List1_Click()
Command1.Enabled = True
Private Sub List2_Click()
Command2.Enabled = True
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