title: Dynamic properties for classes in visual basic
body: <p>I am a vb.net newbie, so please bear with me. Is it possible to create properties (or attributes) for a class in visual basic (I am using Visual Basic 2005) ? All web searches for metaprogramming led me nowhere. Here is an example to clarify what I mean.</p>
  
  <pre><code>public class GenericProps
      public sub new()
         ' ???
      end sub
  
      public sub addProp(byval propname as string)
         ' ???
      end sub
  end class
  
  sub main()
    dim gp as GenericProps = New GenericProps()
    gp.addProp("foo")
    gp.foo = "Bar" ' we can assume the type of the property as string for now
    console.writeln("New property = " &amp; gp.foo)
  end sub
  </code></pre>
  
  <p>So is it possible to define the function addProp ?</p>
  
  <p>Thanks!
  Amit</p>