title: VB.net Access class property from another class
body: <p>I need some help getting my head wrapped about instances and classes.  In the code below I have a main_form, and I am also loading a user_control into the main_form.  I have a property that resides inside main_form that I will be setting data called obj.  My question is when I am doing work inside of the user_control, how can I reach in and set the obj property of main_form.  I tried main_form.obj but I keep getting the error "object reference not set to an instance of an object".  So, I'm not sure how to do it.  Here's the dumbed down code</p>
  
  <pre><code>Public Class FormControlClass
  Private _obj As New objCollection
  
  Public Property obj As objCollection
      Get
          Return _obj
      End Get
      Set(ByVal value As objCollection)
          _obj = value
      End Set
  End Property
  
  'Load User Control Into Form from here.
  me.controls.add('UserControl')
  
  End Class
  
  
  Public Class UserControlClass
  
  'Access the obj property in the form control class from here.
  FormControlClass.obj = 1
  
  End Class
  </code></pre>