Commit f8d47a45 HZH

数字文本框支持小数增加

1 个父辈 bb4a54cb
......@@ -117,6 +117,7 @@ namespace HZH_Controls.Controls
this.Controls.Add(this.txtInput);
this.Controls.Add(this.lblInput);
this.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.IsRadius = true;
this.IsShowRect = true;
this.Name = "UCCombox";
this.Size = new System.Drawing.Size(173, 32);
......
......@@ -174,6 +174,19 @@ namespace HZH_Controls.Controls
/// </summary>
[Description("减少按钮点击事件"), Category("自定义")]
public event EventHandler MinusClick;
private decimal increment = 1;
[Description("递增量,大于0的数值"), Category("自定义")]
public decimal Increment
{
get { return increment; }
set
{
if (value <= 0)
return;
increment = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="UCNumTextBox" /> class.
/// </summary>
......@@ -286,7 +299,7 @@ namespace HZH_Controls.Controls
AddClick(this, e);
}
decimal dec = this.txtNum.Text.ToDecimal();
dec++;
dec += increment;
txtNum.Text = dec.ToString();
}
......@@ -303,7 +316,7 @@ namespace HZH_Controls.Controls
MinusClick(this, e);
}
decimal dec = this.txtNum.Text.ToDecimal();
dec--;
dec -= increment; ;
txtNum.Text = dec.ToString();
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!