Webbrowser basics

eek! an error!

Page 1 of 1

2 Replies - 423 Views - Last Post: 28 May 2009 - 11:09 AM Rate Topic: -----

#1 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Webbrowser basics

Post icon  Posted 28 May 2009 - 10:09 AM

Hi, I have this code to add a favourite to a String array:

   Dim i As String = TextBox2.Text
		My.Settings.Bookmarks.Add(i)
		My.Settings.Save()
		MsgBox(My.Settings.Bookmarks)




I have also tried this:
		My.Settings.Bookmarks.Add(TextBox2.Text)
		My.Settings.Save()
		MsgBox(My.Settings.Bookmarks)



But i get the same error each time, which is:

"Object reference not set to an instance of an object.", the error is for the code:
		My.Settings.Bookmarks.Add(i)





Oh and the textbox does have text in it :D




Thanks in advance for any help

Is This A Good Question/Topic? 0
  • +

Replies To: Webbrowser basics

#2 masteryee  Icon User is offline

  • D.I.C Regular

Reputation: 40
  • View blog
  • Posts: 271
  • Joined: 16-May 09

Re: Webbrowser basics

Posted 28 May 2009 - 10:42 AM

Your "My" object is probably null, so you need to instantiate it first.
Was This Post Helpful? 0
  • +
  • -

#3 Jack Eagles1  Icon User is offline

  • Pugnacious Penguin (inspired by no2pencil)
  • member icon

Reputation: 183
  • View blog
  • Posts: 1,152
  • Joined: 10-December 08

Re: Webbrowser basics

Posted 28 May 2009 - 11:09 AM

Ty, set changed value, worked :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1