title: Instantiate many classes
body: <p>In my current project, a circuit drawing program, I'm deriving many classes from the same base class. </p>
  
  <pre><code>Public MustInherit Class clsCompo
  
  Public Class clsRelay Inherits clsCompo
  Public Class clsResistor Inherits clsCompo
  </code></pre>
  
  <p>Each child class has a 'getIcon' function that provides the desired image of the component. These get loaded in a listview to be used in the drawing program.</p>
  
  <p>Is there an easy way to instantiated these classes to be used? Is there another way than manually instantiating each class? And then adding the image to the listview: something like:</p>
  
  <pre><code>    Dim classes() As String = {"clsResistor", "clsRelay"}
      Dim c(1) As Object
  
      For Each cls As String In classes
          c(1) = New cls
          'add image to listview
      Next
  </code></pre>
  
  <p>I'm using .NET 3.5</p>
  
  <p>Thanks</p>