12-03-13, 09:33 AM
كود :
Dim s As String = "0"
For i As Integer = 0 To ListBox1.Items.Count - 1
If ListBox1.Items.Item(i) = OpenFileDialog1.FileName Then
s = "1"
End If
Next
If s = "0" Then
ListBox1.Items.Add(OpenFileDialog1.FileName)
Else
MsgBox(OpenFileDialog1.FileName & "موجود مسبقا لايمكن اضفاتو", MsgBoxStyle.Critical)
End If