title: UserControl get set Property in C#
body: <p>I am getting an error like</p>
  
  <p>"An unhandled exception of type 'System.StackOverflowException' occurred in ciscontrols.dll".</p>
  
  <p>My code is given below</p>
  
  <pre><code>    private int _vin;
  
      public int MaxLength
      {
          get { return _vin; }
  
          set //Here your answer solve the promblem
          {
              txtLocl.MaxLength = value;
              if (value &lt; 2)
              {
                  throw new ArgumentOutOfRangeException("MaxLength","MaxLength MinValue should be 2.");
              }
              else this._vin = value;
          }
      }
  </code></pre>
  
  <p>i am creating a new property for decimal places</p>
  
  <pre><code>private int Dval;
      public int DecPlaces
      {
          get { return Dval; }
          set// here it showing the same error
          {
              DecPlaces = value; // MaxLength is a preDefined Property but  DecPlaces created by me.
              if (value &lt; 2)
              {
                  throw new ArgumentOutOfRangeException("decplaces", "decimal places minimum value should be 2.");
              }
              else this.Dval = value;
          }
      }
  </code></pre>