Start New Discussion within our Software Development Community
Private Sub Open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Open.Click
        If (BookmarksList.SelectedIndex >= 0) Then
        End If
End Sub

This is the code I made for opening a Bookmark from List yet an error keeps on showing. Any help?

WebBrowser is the main form's name.
BookmarksList is the List Box that contains the Bookmarks.

PS: I've just started to learn VB.NET

When the error shows up, make note of the line it's on. That information is usually pretty important. Off the top of my head, I'd say try SelectedItem.Text instead of SelectedItems.

I've changed it as you told me to and diplayed this error:

Public member 'Text' on type 'String' not found.



SelectedItems implies a collection to me - did intellisense highlight it?

I'd say your looking for either




However, given the error message when you tried SelectedItem.Text is telling you text is not a valid member on type string I'd say the first option is the one you want i.e. SelectedItem


Dude it's perfect thanks.

This question has already been answered. Start a new discussion instead.