* UITextBox: 删除MaximumEnabled、MinimumEnabled、HasMaximum、HasMinimum属性
* UIIntegerUpDown: 修改整数离开判断为实时输入判断 * UIIntegerUpDown: 删除MaximumEnabled、MinimumEnabled、HasMaximum、HasMinimum属性 * UIDoubleUpDown: 修改浮点数大小离开判断为实时输入判断 * UIDoubleUpDown: 删除MaximumEnabled、MinimumEnabled、HasMaximum、HasMinimum属性
This commit is contained in:
parent
71a4664122
commit
7deecb7f73
@ -259,8 +259,6 @@ namespace Sunny.UI
|
|||||||
this.edtA.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.edtA.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.edtA.FillColor = System.Drawing.Color.White;
|
this.edtA.FillColor = System.Drawing.Color.White;
|
||||||
this.edtA.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
this.edtA.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
this.edtA.HasMaximum = true;
|
|
||||||
this.edtA.HasMinimum = true;
|
|
||||||
this.edtA.Location = new System.Drawing.Point(29, 197);
|
this.edtA.Location = new System.Drawing.Point(29, 197);
|
||||||
this.edtA.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.edtA.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.edtA.Maximum = 255D;
|
this.edtA.Maximum = 255D;
|
||||||
@ -278,8 +276,6 @@ namespace Sunny.UI
|
|||||||
this.edtR.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.edtR.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.edtR.FillColor = System.Drawing.Color.White;
|
this.edtR.FillColor = System.Drawing.Color.White;
|
||||||
this.edtR.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
this.edtR.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
this.edtR.HasMaximum = true;
|
|
||||||
this.edtR.HasMinimum = true;
|
|
||||||
this.edtR.Location = new System.Drawing.Point(93, 197);
|
this.edtR.Location = new System.Drawing.Point(93, 197);
|
||||||
this.edtR.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.edtR.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.edtR.Maximum = 255D;
|
this.edtR.Maximum = 255D;
|
||||||
@ -297,8 +293,6 @@ namespace Sunny.UI
|
|||||||
this.edtG.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.edtG.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.edtG.FillColor = System.Drawing.Color.White;
|
this.edtG.FillColor = System.Drawing.Color.White;
|
||||||
this.edtG.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
this.edtG.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
this.edtG.HasMaximum = true;
|
|
||||||
this.edtG.HasMinimum = true;
|
|
||||||
this.edtG.Location = new System.Drawing.Point(158, 197);
|
this.edtG.Location = new System.Drawing.Point(158, 197);
|
||||||
this.edtG.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.edtG.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.edtG.Maximum = 255D;
|
this.edtG.Maximum = 255D;
|
||||||
@ -316,8 +310,6 @@ namespace Sunny.UI
|
|||||||
this.edtB.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.edtB.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.edtB.FillColor = System.Drawing.Color.White;
|
this.edtB.FillColor = System.Drawing.Color.White;
|
||||||
this.edtB.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
this.edtB.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||||
this.edtB.HasMaximum = true;
|
|
||||||
this.edtB.HasMinimum = true;
|
|
||||||
this.edtB.Location = new System.Drawing.Point(222, 197);
|
this.edtB.Location = new System.Drawing.Point(222, 197);
|
||||||
this.edtB.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.edtB.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.edtB.Maximum = 255D;
|
this.edtB.Maximum = 255D;
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
* 2022-02-24: V3.1.1 可以设置按钮大小和颜色
|
* 2022-02-24: V3.1.1 可以设置按钮大小和颜色
|
||||||
* 2022-05-05: V3.1.8 增加禁止输入属性
|
* 2022-05-05: V3.1.8 增加禁止输入属性
|
||||||
* 2022-09-16: V3.2.4 增加是否可以双击输入属性
|
* 2022-09-16: V3.2.4 增加是否可以双击输入属性
|
||||||
|
* 2022-11-12: V3.2.8 修改整数、浮点数大小离开判断为实时输入判断
|
||||||
|
* 2022-11-12: V3.2.8 删除MaximumEnabled、MinimumEnabled、HasMaximum、HasMinimum属性
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -51,7 +53,6 @@ namespace Sunny.UI
|
|||||||
edit.Parent = pnlValue;
|
edit.Parent = pnlValue;
|
||||||
edit.Visible = false;
|
edit.Visible = false;
|
||||||
edit.BorderStyle = BorderStyle.None;
|
edit.BorderStyle = BorderStyle.None;
|
||||||
edit.TextChanged += Edit_TextChanged;
|
|
||||||
edit.Leave += Edit_Leave;
|
edit.Leave += Edit_Leave;
|
||||||
pnlValue.Paint += PnlValue_Paint;
|
pnlValue.Paint += PnlValue_Paint;
|
||||||
}
|
}
|
||||||
@ -89,14 +90,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
edit.Visible = false;
|
edit.Visible = false;
|
||||||
pnlValue.FillColor = pnlColor;
|
pnlValue.FillColor = pnlColor;
|
||||||
}
|
Value = edit.DoubleValue;
|
||||||
}
|
|
||||||
|
|
||||||
private void Edit_TextChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (edit != null && edit.Visible)
|
|
||||||
{
|
|
||||||
Value = edit.Text.ToDouble();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,10 +126,13 @@ namespace Sunny.UI
|
|||||||
get => _value;
|
get => _value;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
value = CheckMaxMin(value);
|
value = edit.CheckMaxMin(value);
|
||||||
_value = value;
|
if (_value != value)
|
||||||
pnlValue.Text = _value.ToString("F" + decLength);
|
{
|
||||||
ValueChanged?.Invoke(this, _value);
|
_value = value;
|
||||||
|
pnlValue.Text = _value.ToString("F" + decLength);
|
||||||
|
ValueChanged?.Invoke(this, _value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,111 +185,20 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private double _maximum = double.MaxValue;
|
[DefaultValue(typeof(double), "2147483647")]
|
||||||
private double _minimum = double.MinValue;
|
|
||||||
|
|
||||||
[DefaultValue(double.MaxValue)]
|
|
||||||
[Description("最大值"), Category("SunnyUI")]
|
[Description("最大值"), Category("SunnyUI")]
|
||||||
public double Maximum
|
public double Maximum
|
||||||
{
|
{
|
||||||
get => _maximum;
|
get => edit.MaxValue;
|
||||||
set
|
set => edit.MaxValue = value;
|
||||||
{
|
|
||||||
_maximum = value;
|
|
||||||
if (_maximum < _minimum)
|
|
||||||
_minimum = _maximum;
|
|
||||||
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.MaxValue = _maximum;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(double.MinValue)]
|
[DefaultValue(typeof(double), "-2147483648")]
|
||||||
[Description("最小值"), Category("SunnyUI")]
|
[Description("最小值"), Category("SunnyUI")]
|
||||||
public double Minimum
|
public double Minimum
|
||||||
{
|
{
|
||||||
get => _minimum;
|
get => edit.MinValue;
|
||||||
set
|
set => edit.MinValue = value;
|
||||||
{
|
|
||||||
_minimum = value;
|
|
||||||
if (_minimum > _maximum)
|
|
||||||
_maximum = _minimum;
|
|
||||||
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.MinValue = _minimum;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private double CheckMaxMin(double value)
|
|
||||||
{
|
|
||||||
if (hasMaximum)
|
|
||||||
{
|
|
||||||
if (value > _maximum)
|
|
||||||
value = _maximum;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasMinimum)
|
|
||||||
{
|
|
||||||
if (value < _minimum)
|
|
||||||
value = _minimum;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false)]
|
|
||||||
[Description("是否判断最大值显示"), Category("SunnyUI")]
|
|
||||||
public bool MaximumEnabled
|
|
||||||
{
|
|
||||||
get => HasMaximum;
|
|
||||||
set => HasMaximum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false)]
|
|
||||||
[Description("是否判断最小值显示"), Category("SunnyUI")]
|
|
||||||
public bool MinimumEnabled
|
|
||||||
{
|
|
||||||
get => HasMinimum;
|
|
||||||
set => HasMinimum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool hasMaximum;
|
|
||||||
private bool hasMinimum;
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("检查最大值"), Category("SunnyUI")]
|
|
||||||
public bool HasMaximum
|
|
||||||
{
|
|
||||||
get => hasMaximum;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (hasMaximum != value)
|
|
||||||
{
|
|
||||||
hasMaximum = value;
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.HasMaxValue = value;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("检查最小值"), Category("SunnyUI")]
|
|
||||||
public bool HasMinimum
|
|
||||||
{
|
|
||||||
get => hasMinimum;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (hasMinimum != value)
|
|
||||||
{
|
|
||||||
hasMinimum = value;
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.HasMinValue = value;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(true)]
|
[DefaultValue(true)]
|
||||||
|
@ -377,36 +377,6 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Browsable(false), DefaultValue(false)]
|
|
||||||
public bool HasMaxValue { get; set; }
|
|
||||||
//{
|
|
||||||
// get => hasMaxValue;
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// if (hasMaxValue != value)
|
|
||||||
// {
|
|
||||||
// hasMaxValue = value;
|
|
||||||
// CheckMaxMin();
|
|
||||||
// Invalidate();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
[Browsable(false), DefaultValue(false)]
|
|
||||||
public bool HasMinValue { get; set; }
|
|
||||||
//{
|
|
||||||
// get => hasMinValue;
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// if (hasMinValue != value)
|
|
||||||
// {
|
|
||||||
// hasMinValue = value;
|
|
||||||
// CheckMaxMin();
|
|
||||||
// Invalidate();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
[DefaultValue(0)]
|
[DefaultValue(0)]
|
||||||
public double DoubleValue
|
public double DoubleValue
|
||||||
{
|
{
|
||||||
@ -417,8 +387,8 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
CheckMaxMin();
|
|
||||||
Text = value.ToString("f" + decLength);
|
Text = value.ToString("f" + decLength);
|
||||||
|
CheckMaxMin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,8 +402,8 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
CheckMaxMin();
|
|
||||||
Text = value.ToString();
|
Text = value.ToString();
|
||||||
|
CheckMaxMin();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,6 +554,36 @@ namespace Sunny.UI
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double CheckMaxMin(double value)
|
||||||
|
{
|
||||||
|
if (_uiEditType == UITextBox.UIEditType.Integer)
|
||||||
|
{
|
||||||
|
if (value > MaxValue)
|
||||||
|
value = (int)MaxValue;
|
||||||
|
if (value < MinValue)
|
||||||
|
value = (int)MinValue;
|
||||||
|
|
||||||
|
Text = value.ToString();
|
||||||
|
SelectionStart = Text.Length;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_uiEditType == UITextBox.UIEditType.Double)
|
||||||
|
{
|
||||||
|
if (value > MaxValue)
|
||||||
|
value = MaxValue;
|
||||||
|
|
||||||
|
if (value < MinValue)
|
||||||
|
value = MinValue;
|
||||||
|
|
||||||
|
Text = value.ToString("f" + decLength);
|
||||||
|
SelectionStart = Text.Length;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
public void CheckMaxMin()
|
public void CheckMaxMin()
|
||||||
{
|
{
|
||||||
if (_uiEditType == UITextBox.UIEditType.Integer)
|
if (_uiEditType == UITextBox.UIEditType.Integer)
|
||||||
@ -592,12 +592,18 @@ namespace Sunny.UI
|
|||||||
if (!int.TryParse(Text, out var a)) return;
|
if (!int.TryParse(Text, out var a)) return;
|
||||||
|
|
||||||
if (a > MaxValue)
|
if (a > MaxValue)
|
||||||
|
{
|
||||||
a = (int)MaxValue;
|
a = (int)MaxValue;
|
||||||
if (a < MinValue)
|
Text = a.ToString();
|
||||||
a = (int)MinValue;
|
SelectionStart = Text.Length;
|
||||||
|
}
|
||||||
|
|
||||||
Text = a.ToString();
|
if (a < MinValue)
|
||||||
SelectionStart = Text.Length;
|
{
|
||||||
|
a = (int)MinValue;
|
||||||
|
Text = a.ToString();
|
||||||
|
SelectionStart = Text.Length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_uiEditType == UITextBox.UIEditType.Double)
|
if (_uiEditType == UITextBox.UIEditType.Double)
|
||||||
@ -606,13 +612,18 @@ namespace Sunny.UI
|
|||||||
if (!double.TryParse(Text, out var a)) return;
|
if (!double.TryParse(Text, out var a)) return;
|
||||||
|
|
||||||
if (a > MaxValue)
|
if (a > MaxValue)
|
||||||
|
{
|
||||||
a = MaxValue;
|
a = MaxValue;
|
||||||
|
Text = a.ToString("f" + decLength);
|
||||||
|
SelectionStart = Text.Length;
|
||||||
|
}
|
||||||
|
|
||||||
if (a < MinValue)
|
if (a < MinValue)
|
||||||
|
{
|
||||||
a = MinValue;
|
a = MinValue;
|
||||||
|
Text = a.ToString("f" + decLength);
|
||||||
Text = a.ToString("f" + decLength);
|
SelectionStart = Text.Length;
|
||||||
SelectionStart = Text.Length;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
* 2022-02-24: V3.1.1 可以设置按钮大小和颜色
|
* 2022-02-24: V3.1.1 可以设置按钮大小和颜色
|
||||||
* 2022-05-05: V3.1.8 增加禁止输入属性
|
* 2022-05-05: V3.1.8 增加禁止输入属性
|
||||||
* 2022-09-16: V3.2.4 增加是否可以双击输入属性
|
* 2022-09-16: V3.2.4 增加是否可以双击输入属性
|
||||||
|
* 2022-11-12: V3.2.8 修改整数、浮点数大小离开判断为实时输入判断
|
||||||
|
* 2022-11-12: V3.2.8 删除MaximumEnabled、MinimumEnabled、HasMaximum、HasMinimum属性
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -48,7 +50,6 @@ namespace Sunny.UI
|
|||||||
edit.Parent = pnlValue;
|
edit.Parent = pnlValue;
|
||||||
edit.Visible = false;
|
edit.Visible = false;
|
||||||
edit.BorderStyle = BorderStyle.None;
|
edit.BorderStyle = BorderStyle.None;
|
||||||
edit.TextChanged += Edit_TextChanged;
|
|
||||||
edit.Leave += Edit_Leave;
|
edit.Leave += Edit_Leave;
|
||||||
pnlValue.Paint += PnlValue_Paint;
|
pnlValue.Paint += PnlValue_Paint;
|
||||||
}
|
}
|
||||||
@ -86,14 +87,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
edit.Visible = false;
|
edit.Visible = false;
|
||||||
pnlValue.FillColor = pnlColor;
|
pnlValue.FillColor = pnlColor;
|
||||||
}
|
Value = edit.IntValue;
|
||||||
}
|
|
||||||
|
|
||||||
private void Edit_TextChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (edit != null && edit.Visible)
|
|
||||||
{
|
|
||||||
Value = edit.Text.ToInt();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +102,7 @@ namespace Sunny.UI
|
|||||||
get => _value;
|
get => _value;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
value = CheckMaxMin(value);
|
value = (int)edit.CheckMaxMin(value);
|
||||||
if (_value != value)
|
if (_value != value)
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = value;
|
||||||
@ -174,111 +168,20 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _maximum = int.MaxValue;
|
|
||||||
private int _minimum = int.MinValue;
|
|
||||||
|
|
||||||
[Description("最大值"), Category("SunnyUI")]
|
[Description("最大值"), Category("SunnyUI")]
|
||||||
[DefaultValue(int.MaxValue)]
|
[DefaultValue(int.MaxValue)]
|
||||||
public int Maximum
|
public int Maximum
|
||||||
{
|
{
|
||||||
get => _maximum;
|
get => (int)edit.MaxValue;
|
||||||
set
|
set => edit.MaxValue = value;
|
||||||
{
|
|
||||||
_maximum = value;
|
|
||||||
if (_maximum < _minimum)
|
|
||||||
_minimum = _maximum;
|
|
||||||
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.MaxValue = _maximum;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Description("最小值"), Category("SunnyUI")]
|
[Description("最小值"), Category("SunnyUI")]
|
||||||
[DefaultValue(int.MinValue)]
|
[DefaultValue(int.MinValue)]
|
||||||
public int Minimum
|
public int Minimum
|
||||||
{
|
{
|
||||||
get => _minimum;
|
get => (int)edit.MinValue;
|
||||||
set
|
set => edit.MinValue = value;
|
||||||
{
|
|
||||||
_minimum = value;
|
|
||||||
if (_minimum > _maximum)
|
|
||||||
_maximum = _minimum;
|
|
||||||
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.MinValue = _maximum;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int CheckMaxMin(int value)
|
|
||||||
{
|
|
||||||
if (hasMaximum)
|
|
||||||
{
|
|
||||||
if (value > _maximum)
|
|
||||||
value = _maximum;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasMinimum)
|
|
||||||
{
|
|
||||||
if (value < _minimum)
|
|
||||||
value = _minimum;
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false)]
|
|
||||||
[Description("是否判断最大值显示"), Category("SunnyUI")]
|
|
||||||
public bool MaximumEnabled
|
|
||||||
{
|
|
||||||
get => HasMaximum;
|
|
||||||
set => HasMaximum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false)]
|
|
||||||
[Description("是否判断最小值显示"), Category("SunnyUI")]
|
|
||||||
public bool MinimumEnabled
|
|
||||||
{
|
|
||||||
get => HasMinimum;
|
|
||||||
set => HasMinimum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool hasMaximum;
|
|
||||||
private bool hasMinimum;
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("检查最大值"), Category("SunnyUI")]
|
|
||||||
public bool HasMaximum
|
|
||||||
{
|
|
||||||
get => hasMaximum;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (hasMaximum != value)
|
|
||||||
{
|
|
||||||
hasMaximum = value;
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.HasMaxValue = value;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("检查最小值"), Category("SunnyUI")]
|
|
||||||
public bool HasMinimum
|
|
||||||
{
|
|
||||||
get => hasMinimum;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (hasMinimum != value)
|
|
||||||
{
|
|
||||||
hasMinimum = value;
|
|
||||||
Value = CheckMaxMin(Value);
|
|
||||||
edit.HasMinValue = value;
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(true)]
|
[DefaultValue(true)]
|
||||||
|
@ -682,12 +682,10 @@ namespace Sunny.UI
|
|||||||
this.edtPage.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.edtPage.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.edtPage.DoubleValue = 10D;
|
this.edtPage.DoubleValue = 10D;
|
||||||
this.edtPage.Font = new System.Drawing.Font("微软雅黑", 12F);
|
this.edtPage.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||||
this.edtPage.HasMinimum = true;
|
|
||||||
this.edtPage.IntValue = 10;
|
this.edtPage.IntValue = 10;
|
||||||
this.edtPage.Location = new System.Drawing.Point(28, 0);
|
this.edtPage.Location = new System.Drawing.Point(28, 0);
|
||||||
this.edtPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.edtPage.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.edtPage.Minimum = 1D;
|
this.edtPage.Minimum = 1D;
|
||||||
this.edtPage.MinimumEnabled = true;
|
|
||||||
this.edtPage.MinimumSize = new System.Drawing.Size(1, 1);
|
this.edtPage.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.edtPage.Name = "edtPage";
|
this.edtPage.Name = "edtPage";
|
||||||
this.edtPage.Padding = new System.Windows.Forms.Padding(5);
|
this.edtPage.Padding = new System.Windows.Forms.Padding(5);
|
||||||
@ -816,7 +814,6 @@ namespace Sunny.UI
|
|||||||
b16.Visible = true;
|
b16.Visible = true;
|
||||||
|
|
||||||
PageCount = TotalCount.Mod(PageSize) == 0 ? TotalCount / PageSize : TotalCount / PageSize + 1;
|
PageCount = TotalCount.Mod(PageSize) == 0 ? TotalCount / PageSize : TotalCount / PageSize + 1;
|
||||||
edtPage.HasMaximum = true;
|
|
||||||
edtPage.Maximum = PageCount;
|
edtPage.Maximum = PageCount;
|
||||||
|
|
||||||
if (activePage >= PageCount)
|
if (activePage >= PageCount)
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
* 2022-09-16: V3.2.4 修改右侧Button可能不显示的问题
|
* 2022-09-16: V3.2.4 修改右侧Button可能不显示的问题
|
||||||
* 2022-11-03: V3.2.6 增加了可设置垂直滚动条宽度的属性
|
* 2022-11-03: V3.2.6 增加了可设置垂直滚动条宽度的属性
|
||||||
* 2022-11-12: V3.2.8 修改整数、浮点数大小离开判断为实时输入判断
|
* 2022-11-12: V3.2.8 修改整数、浮点数大小离开判断为实时输入判断
|
||||||
|
* 2022-11-12: V3.2.8 删除MaximumEnabled、MinimumEnabled、HasMaximum、HasMinimum属性
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -729,38 +730,6 @@ namespace Sunny.UI
|
|||||||
set => edit.MinValue = value;
|
set => edit.MinValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("是否判断最大值显示"), Category("SunnyUI")]
|
|
||||||
public bool MaximumEnabled
|
|
||||||
{
|
|
||||||
get => HasMaximum;
|
|
||||||
set => HasMaximum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("是否判断最小值显示"), Category("SunnyUI")]
|
|
||||||
public bool MinimumEnabled
|
|
||||||
{
|
|
||||||
get => HasMinimum;
|
|
||||||
set => HasMinimum = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("是否判断最大值显示"), Category("SunnyUI")]
|
|
||||||
public bool HasMaximum
|
|
||||||
{
|
|
||||||
get => edit.HasMaxValue;
|
|
||||||
set => edit.HasMaxValue = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(false), Browsable(false)]
|
|
||||||
[Description("是否判断最小值显示"), Category("SunnyUI")]
|
|
||||||
public bool HasMinimum
|
|
||||||
{
|
|
||||||
get => edit.HasMinValue;
|
|
||||||
set => edit.HasMinValue = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[DefaultValue(0.00)]
|
[DefaultValue(0.00)]
|
||||||
[Description("浮点返回值"), Category("SunnyUI")]
|
[Description("浮点返回值"), Category("SunnyUI")]
|
||||||
public double DoubleValue
|
public double DoubleValue
|
||||||
|
@ -386,8 +386,6 @@ namespace Sunny.UI
|
|||||||
frm.Editor.MaxLength = 11;
|
frm.Editor.MaxLength = 11;
|
||||||
frm.Editor.Minimum = minimum;
|
frm.Editor.Minimum = minimum;
|
||||||
frm.Editor.Maximum = maximum;
|
frm.Editor.Maximum = maximum;
|
||||||
frm.Editor.HasMaximum = true;
|
|
||||||
frm.Editor.HasMinimum = true;
|
|
||||||
if (showMask)
|
if (showMask)
|
||||||
frm.ShowDialogWithMask();
|
frm.ShowDialogWithMask();
|
||||||
else
|
else
|
||||||
@ -476,8 +474,6 @@ namespace Sunny.UI
|
|||||||
frm.CheckInputEmpty = checkEmpty;
|
frm.CheckInputEmpty = checkEmpty;
|
||||||
frm.Editor.Minimum = minimum;
|
frm.Editor.Minimum = minimum;
|
||||||
frm.Editor.Maximum = maximum;
|
frm.Editor.Maximum = maximum;
|
||||||
frm.Editor.HasMaximum = true;
|
|
||||||
frm.Editor.HasMinimum = true;
|
|
||||||
if (showMask)
|
if (showMask)
|
||||||
frm.ShowDialogWithMask();
|
frm.ShowDialogWithMask();
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user