title: How to add repeated values to string collection?
body: <p>I'm currently working on a project I've been making for a few months now. It is close to having version 2 released, which will include bookmarks. To store these bookmarks, I have used the Settings menu in the project's Properties. I created two <code>System.Collections.Specialized.StringCollection</code>'s, one called "BookmarkNames" and the other called "BookmarkAddresses." I have a menu in a dropdown from the menu bar in my app that has the bookmark buttons. These are added on startup by iterating through the collections with a for-next loop. To test it, I made it add 2 items to each. Before it does the button-adding, I add "Bing" and "Google" to <code>My.Settings.BookmarkNames</code> and their respective addresses to <code>My.Settings.BookmarkAddresses</code>. I noticed that when it finishes launching, it only added one button, called "Bing." Clicking the button did go to the Bing site, so it must have done something right. However, it has skipped Google. To see what has happened, I added a simple <code>Console.PrintLine()</code> to the end of the for-next loop. This prints the item that it is currently on in the BookmarkNames collection, and thus it should print two lines: "Google" and "Bing." However, it prints random numbers of each, sometimes it'll say "Google" 5 times then alternate between "Google" and "Bing."</p>
  
  <p>My question is simple: What is the reason for the extra repeated values? Why are they being added and printed? I can figure out the whole "one button being created" problem myself, as long as I can figure out what is going on there.</p>
  
  <p><strong>The code in question is:</strong></p>
  
  <pre><code>'WRE: This loads the bookmarks into the bookmarks menu.
  My.Settings.BookmarksNames.Add("Google")
  My.Settings.BookmarksAddresses.Add("http://www.google.com/")
  My.Settings.BookmarksNames.Add("Bing")
  My.Settings.BookmarksAddresses.Add("http://www.bing.com/")
  If My.Settings.BookmarksAddresses.Count &gt; 0 Then
      For counter As Integer = 0 To My.Settings.BookmarksAddresses.Count - 1
          bmb.Text = My.Settings.BookmarksNames.Item(counter)
          bmb.bookmarkURL = My.Settings.BookmarksAddresses.Item(counter)
          but_Bmarks.DropDownItems.Add(bmb)
          Console.WriteLine(My.Settings.BookmarksNames.Item(counter))
      Next
  Else
      ...
  End If
  </code></pre>