Properties

If I pass a value to a form like this.  Does it use the property ?

  private int myVal;
        public int MyVal{ get { return myVal; } set { myVal= value; } }
 public Frm1(int myVal)
        {
          //Do something with myVal
        }

Passing the value like this.....
Frm1 frm1 = new Frm1(AnotherValue);

Or should I use
frm1.MyValue = AnotherValue;
u2envy1Asked:
Who is Participating?
 
p_davisConnect With a Mentor Commented:
to use the property you would use thhe frm1.MyValue -- the other way is using the constructor of the form
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.