I need to delete duplicating input..
for example.
in a list box I input
a
a
a
b
b
then I want to delete all 'a'
the listbox must show:
b
b
i hope there is someone who can help me..thanks!!
Public Class Form1
Private Sub btnadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnadd.Click
lstshow.Items.Add(txtinput.Text)
txtinput.Text = Nothing
End Sub
Private Sub btndelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndelete.Click
Dim delete As String
Dim found As Boolean = False
Dim position As Integer
Dim num As Integer
num = lstshow.Items.Count - 1
delete = InputBox("Enter Item to be Deleted: ")
For i As Integer = 0 To (lstshow.Items.Count - 1)
If delete = lstshow.Items(i) Then
found = True
position = i
lstshow.Items.RemoveAt(position)
End If
Exit For
Next i
End Sub
End Class