title: How to assign random colors to shapes in vb6 form
body: <p>I am developing a game using VB6.0, I want to generate randomly moving shapes (<strong>circles, squares, rectangles, ovals, etc.</strong>) with different colors in the background of form. I am using timers and shapes to achieve this.my contribution is furnished below.</p>
  
  <pre><code>Private Sub Timer1_Timer()
      For i = 0 To 20
          s_left = Round(Rnd * 20050)
          s_top = Round(Rnd * 860)
          shape(i).Left = s_left
          shape(i).Top = s_top
          shape(i).Visible = True
      Next i
  End Sub
  </code></pre>
  
  <p>Now the problem is that, I can use only one shape and one color, is there any possibility to select a random color and shape within this Timer1_Timer()?</p>