Hi to all,

My situation is: Im working on a webbrowser project, i created a favorites toolbar, but i didnt know how to create the custom item that has a value and a displayname kinda property, so i asked in this forum, i got help so what i have so far its this :

This its the custom class that will contain the url and the webpage name
Vb Code:
  1. Public Class WebPageInfo
  2.  
  3.   Private _title As String
  4.     Private _url As String
  5.     Public Property Title() As String
  6.         Get
  7.             Return Me._title
  8.         End Get
  9.         Set(ByVal value As String)
  10.             Me._title = value
  11.         End Set
  12.     End Property
  13.     Public Property Url() As String
  14.         Get
  15.             Return Me._url
  16.  
  17.         End Get
  18.         Set(ByVal value As String)
  19.             Me._url = value
  20.         End Set
  21.     End Property
  22.     Public Sub New(ByVal title As String, ByVal url As String)
  23.         Me._title = title
  24.         Me._url = url
  25.     End Sub
  26. End Class
Okay, thats my webpageinfo class,


Vb Code:
  1. Dim pageinfos As New System.ComponentModel.BindingList(Of WebPageInfo)
  2.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3.         Me.BindingSource1.DataSource = Me.pageinfos
  4.         Me.ListBox1.DisplayMember = "Title"
  5.         Me.ListBox1.ValueMember = "Url"
  6.         Me.ListBox1.DataSource = Me.BindingSource1
  7.     End Sub

Here comes my question.
Vb Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.  Me.pageinfos.Add(New WebPageInfo(WebBrowser1.DocumentTitle, WebBrowser1.Url.ToString))
  3.     End Sub

In this event i would like to add the new item created just ONCE but i dont know how to, i have an idea of how it could be done, can someone give me clues on how to do this ? thanks

my idea its something like this :

Vb Code:
  1. Dim n as object
  2. for each n in pageinfos
  3. Dim once as integer
  4. once=listbox1.findstring(listbox1.displaymember)
  5. if (once=-1) then
  6.                 Me.pageinfos.Add(New WebPageInfo(WebBrowser1.DocumentTitle, WebBrowser1.Url.ToString))
it could be something like that, right ?

Thanks for your help