Jason Anderson

Jason Anderson

  • NA
  • 7
  • 45.5k

How to get properties from another class?

May 10 2011 12:01 PM
I have a struct (structA) where I want to have a property that holds properties for another class (ClassB).

struct structA
{
public ClassB PropertyA {get; set;}
}

class ClassB
{
int PropertyB1....
int PropertyB2....
int PropertyB3....
}

I want to do this in another class (ClassC)

structA.PropertyA.ClassB = 10

But I always get "Object reference not set to an instance of an object."

Any ideas?

Thanks.

Jason


Answers (1)