title: VB2010 for x in y equivalent
body: <p>Trying VB for the first time and need some help.</p>
  
  <p>I have a list box that I would like to run the same task for each of the lostbox items when a button is clicked. In python i would use <code>for x in y:</code></p>
  
  <p>But what do i do for vb? </p>
  
  <p>Code thus far </p>
  
  <pre><code>Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  
  Dim mesg As String
  Dim pw As String
  Dim id As String
  For i As Integer = 0 To Me.ListBox2.Items.Count - 1
   id = Me.ListBox2.Items(i).ToString
   mesg = TextBox1.Text.ToString()         
   pw = "S"
   MessageBox.Show(id &amp; mesg &amp; pw, "test")
  Exit For
  
     Next
  End Sub
  </code></pre>
  
  <p>So i want that message box for each item in the listbox once <em>ok</em> has been clicked</p>