Hi to all,
im creating a webbrowser, with a favorites function using a listbox and a bindingsource and this is how i did it :
with help of this forum i created a sort of custom object, ill post it here :
Vb .net Code:
Public Class Favorites Private _title As String Private _url As String Public Property Title() As String Get Return Me._title End Get Set(ByVal value As String) Me._title = value End Set End Property Public Property Url() As String Get Return Me._url End Get Set(ByVal value As String) Me._url = value End Set End Property Public Sub New(ByVal title As String, ByVal url As String) Me._title = title Me._url = url End Sub End Class
and the code i use to add new items to the listbox is this :
add new item
Vb .net Code:
Dim N As Integer N = Favs.FindStringExact(Applicationhelper _ .CurrentBrowser.DocumentTitle) If (N = -1) Then Me.Listoffavorites.Add(New Favorites(Applicationhelper _ .CurrentBrowser.DocumentTitle, Applicationhelper _ .CurrentBrowser.Url.ToString)) End If
set the data to the listbox
Vb .net Code:
Dim Listoffavorites As New System.ComponentModel.BindingList(Of Favorites) Me.BindingSource1.DataSource = Me.Listoffavorites Me.Favs.DisplayMember = "Title" Me.Favs.ValueMember = "Url" Me.Favs.DataSource = Me.BindingSource1
well, now that i described what i have done ill tell u what i want to do
i want to save those items in a textbox or in anyway, can anyone help me ?
thanks![]()




Reply With Quote