【发布时间】:2013-03-08 03:48:29
【问题描述】:
我收到类似的错误
“在 ciscontrols.dll 中发生了“System.StackOverflowException”类型的未处理异常”。
我的代码如下
private int _vin;
public int MaxLength
{
get { return _vin; }
set //Here your answer solve the promblem
{
txtLocl.MaxLength = value;
if (value < 2)
{
throw new ArgumentOutOfRangeException("MaxLength","MaxLength MinValue should be 2.");
}
else this._vin = value;
}
}
我正在为小数位创建一个新属性
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 < 2)
{
throw new ArgumentOutOfRangeException("decplaces", "decimal places minimum value should be 2.");
}
else this.Dval = value;
}
}
【问题讨论】:
标签: c# winforms user-controls textbox get