What I want to do is, if the variable is set to something that's not between 1 and 4, don't change the value of Orientation; however, when you try it, the "Orientation = value;" line triggers the "set" of the property again so I get a stack overflow. Any ideas? I'd like for the error checking to occur within the set statement if at all possible.Code:private int Orientation { get { return Orientation; } set { if ((value > 0) && (value < 5)) Orientation = value; } }
Dan




Reply With Quote