Why are you using directly mVar instead of using the public property Var?
On Feb 10, 9:16 am, jacksmash <[email protected]> wrote: > public class MyClass : UserControl > { > private int mVar; > > public int Var > { > get {return mVar;} > set {mVar = value;} > } > > public MyClass() > { > mVar = 8; > > Console.WriteLine("mVar = {0}", mVar}; > } > > private void MyClass_Paint(...) > { > Console.WriteLine("mVar = {0}", mVar}; > } > > } > > --- > > Output: > mVar = 8 > mVar = 1 > > Why does the instance variable not keep the originally assigned value > (via the constructor)?
