0

Im try to make a web browser with the history it keeps giving me this error An exception of type 'System.NullReferenceException' occurred in WindowsApplication34.exe but was not handled in user code

Here is where im getting the error

Private Sub Browser_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
    My.Settings.History.Add(WebBrowser1.Url.ToString)
End Sub
Tim Schmelter
  • 411,418
  • 61
  • 614
  • 859
  • 1
    How is it a duplicate i couldnt find one like myn – Adam Films Jul 27 '16 at 09:18
  • 1
    Set a breakpoint on the line, and starting with `My`, check each item for `Nothing` – A Friend Jul 27 '16 at 09:21
  • I've experienced this before when using a `StringCollection` setting. To fix it: Go to the `Settings` tab in the application properties > Select your `History` setting's third column and press the `...` button > Write something in the first line to add an item > Press OK > Press the `...` button again > Remove what you wrote in the box > Run your application > No more error. – Visual Vincent Jul 27 '16 at 10:24
  • Thank you verry much i will try that when i get home – Adam Films Jul 27 '16 at 10:51

0 Answers0