• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 209
  • Last Modified:

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;
0
u2envy1
Asked:
u2envy1
1 Solution
 
p_davisCommented:
to use the property you would use thhe frm1.MyValue -- the other way is using the constructor of the form
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now