Reputation: 350
I want to add the current progressbar value when it's not in the listbox. I want it to add a new item when the progressbar value changes.
Here is my code so far... It just adds "0%" a million times..
Dim PText As String = ProgressBar1.Value
If Not PText = LB1.Items.ToString Then
LB1.Items.Add("Uploaded " & PText & "%")
End If
Upvotes: 1
Views: 118
Reputation: 5423
Try this :
Dim PText As String = String.Format("Uploaded {0}%",ProgressBar1.Value)
If Not LB1.Items.Contains(PText) Then LB1.Items.Add(PText)
Upvotes: 2