title: Only one dynamically created picture box showing?
body: <p>I have to add multiple picture boxes depending on the length of a certain word. for example say it was six. That would mean i would need to create 6 picture boxes. Where it gets a bit trickier is the fact that i need these to stay centered. That is i need them picture boxes always to be centered all together like there are lined up in a horizontal row. I have a plan for that the only problem is that i can't seem to create more than one picturebox. This is my code so far.</p>
  
  <pre><code>    Dim dash(Len(correctWord) - 1) As PictureBox
      Dim count = 0
      Dim buffer = 55 * count
      While count &lt;&gt; Len(correctWord)
          dash(count) = New PictureBox
          dash(count).Image = My.Resources.dash
          dash(count).Visible = True
          dash(count).Width = 50
          dash(count).Height = 80
          dash(count).Top = 300
          If ((count Mod 2) = 0) Then
              dash(count).Left = (273 + (55 * buffer))
          Else
              dash(count).Left = (273 - (55 * buffer))
          End If
          Controls.Add(dash(count))
          count = count + 1
      End While
  </code></pre>
  
  <p>No matter how hard i try it only displays one picturebox. If anyone could be of assistance that would be greatly appreciated.</p>