title: Initialise array using Array.ForEach - VB.NET
body: <p>I have an array of RichTextBoxes and I would like to initialise them using Array.ForEach.</p>
  
  <p>I have made the following attempt with no success:</p>
  
  <pre><code>Dim aRTB(5) as RichTextBox
  Array.ForEach(aRTB, Function() New RichTextBox)
  </code></pre>
  
  <p>This code was the only one to make it past the compiler however it doesn't initialise any part of the array.</p>
  
  <p>Code which failed to past the compiler includes:</p>
  
  <pre><code>Array.ForEach(aRTB, Function() Return New RichTextBox)
  Array.ForEach(aRTB, Function(rtb as RichTextBox) rtb = New RichTextBox)
  </code></pre>
  
  <p>I realise I could easily set up a a regular loop (For, Do, While) to perform the same action however I would like to see if this way can work.</p>
  
  <p>Thank you for any help.</p>