by Dave Deponeo (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 31st March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This program is used to add and remove data from a List box
lstClient.AddItem txtName.Text
txtName.Text = ""
txtName.SetFocus
lblDisplay.Caption = lstClient.ListCount
End Sub
Private Sub cmdClear_Click()
lstClient.Clear
cmdRemove.Enalbed = False
lblDisplay.Caption = lstClient.ListCount
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdRemove_Click()
Dim Ind As Integer
Ind = lstClient.ListIndex
If Ind >= 0 Then
lstClient.RemoveItem Ind
lblDisplay.Caption = lstClient.ListCount
Else
Beep
End If
cmdRemove.Enabled = (lstClient.ListIndex <> -1)
End Sub
Private Sub lstClient_Click()
cmdRemove.Enabled = lstClient.ListIndex <> -1
End Sub
Private Sub txtName_Change()
cmdAdd.Enabled = (Len(txtName.Text) > 0)
End Sub