*UIDoubleUpDown:增加Readonly属性

*UIIntegerUpDown:增加Readonly属性
This commit is contained in:
Sunny 2021-12-10 11:17:16 +08:00
parent b346a8e156
commit 6fc54cf7e8
4 changed files with 23 additions and 1 deletions

Binary file not shown.

View File

@ -19,6 +19,7 @@
* 2020-01-01: V2.2.0 * 2020-01-01: V2.2.0
* 2020-04-25: V2.2.4 * 2020-04-25: V2.2.4
* 2020-08-14: V2.2.7 * 2020-08-14: V2.2.7
* 2020-12-10: V3.0.9 Readonly属性
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -137,6 +138,8 @@ namespace Sunny.UI
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)
{ {
if (ReadOnly) return;
Value += Step; Value += Step;
if (edit.Visible) if (edit.Visible)
{ {
@ -147,6 +150,8 @@ namespace Sunny.UI
private void btnDec_Click(object sender, EventArgs e) private void btnDec_Click(object sender, EventArgs e)
{ {
if (ReadOnly) return;
Value -= Step; Value -= Step;
if (edit.Visible) if (edit.Visible)
{ {
@ -266,6 +271,8 @@ namespace Sunny.UI
private Color pnlColor; private Color pnlColor;
private void pnlValue_DoubleClick(object sender, EventArgs e) private void pnlValue_DoubleClick(object sender, EventArgs e)
{ {
if (ReadOnly) return;
edit.Left = 1; edit.Left = 1;
edit.Top = (pnlValue.Height - edit.Height) / 2; edit.Top = (pnlValue.Height - edit.Height) / 2;
edit.Width = pnlValue.Width - 2; edit.Width = pnlValue.Width - 2;
@ -279,5 +286,9 @@ namespace Sunny.UI
edit.Focus(); edit.Focus();
edit.SelectAll(); edit.SelectAll();
} }
[DefaultValue(false)]
[Description("是否只读"), Category("SunnyUI")]
public bool ReadOnly { get; set; }
} }
} }

View File

@ -19,6 +19,7 @@
* 2020-01-01: V2.2.0 * 2020-01-01: V2.2.0
* 2020-04-25: V2.2.4 * 2020-04-25: V2.2.4
* 2020-08-14: V2.2.7 * 2020-08-14: V2.2.7
* 2020-12-10: V3.0.9 Readonly属性
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -131,6 +132,8 @@ namespace Sunny.UI
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)
{ {
if (ReadOnly) return;
Value += Step; Value += Step;
if (edit.Visible) if (edit.Visible)
{ {
@ -141,6 +144,8 @@ namespace Sunny.UI
private void btnDec_Click(object sender, EventArgs e) private void btnDec_Click(object sender, EventArgs e)
{ {
if (ReadOnly) return;
Value -= Step; Value -= Step;
if (edit.Visible) if (edit.Visible)
{ {
@ -260,6 +265,8 @@ namespace Sunny.UI
private Color pnlColor; private Color pnlColor;
private void pnlValue_DoubleClick(object sender, EventArgs e) private void pnlValue_DoubleClick(object sender, EventArgs e)
{ {
if (ReadOnly) return;
edit.Left = 1; edit.Left = 1;
edit.Top = (pnlValue.Height - edit.Height) / 2; edit.Top = (pnlValue.Height - edit.Height) / 2;
edit.Width = pnlValue.Width - 2; edit.Width = pnlValue.Width - 2;
@ -272,5 +279,9 @@ namespace Sunny.UI
edit.Focus(); edit.Focus();
edit.SelectAll(); edit.SelectAll();
} }
[DefaultValue(false)]
[Description("是否只读"), Category("SunnyUI")]
public bool ReadOnly { get; set; }
} }
} }

View File

@ -16,7 +16,7 @@
* : V3.0 * : V3.0
* : 2020-12-10 * : 2020-12-10
* *
* 2020-01-01: V3.0.9 * 2020-12-10: V3.0.9
******************************************************************************/ ******************************************************************************/
using System.Drawing; using System.Drawing;