* 修复日期选择控件值切换响应两次

This commit is contained in:
Sunny 2022-01-15 21:45:28 +08:00
parent ef146ceff8
commit f425f9fdd3
6 changed files with 6 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View File

@ -126,6 +126,7 @@ namespace Sunny.UI.Demo
private void uiDatePicker3_ValueChanged(object sender, DateTime value) private void uiDatePicker3_ValueChanged(object sender, DateTime value)
{ {
ShowInfoTip(uiDatePicker3.Value.DateString()); ShowInfoTip(uiDatePicker3.Value.DateString());
Console.WriteLine(uiDatePicker3.Value);
} }
} }
} }

View File

@ -93,7 +93,7 @@ namespace Sunny.UI
try try
{ {
DateTime dt = Text.ToDateTime(DateFormat); DateTime dt = Text.ToDateTime(DateFormat);
Value = dt; if (Value != dt) Value = dt;
} }
catch catch
{ {

View File

@ -81,7 +81,7 @@ namespace Sunny.UI
try try
{ {
DateTime dt = Text.ToDateTime(DateFormat); DateTime dt = Text.ToDateTime(DateFormat);
Value = dt; if (Value != dt) Value = dt;
} }
catch catch
{ {
@ -100,8 +100,7 @@ namespace Sunny.UI
try try
{ {
DateTime dt = Text.ToDateTime(DateFormat); DateTime dt = Text.ToDateTime(DateFormat);
if (Value != dt) if (Value != dt) Value = dt;
Value = dt;
} }
catch catch
{ {

View File

@ -73,7 +73,7 @@ namespace Sunny.UI
try try
{ {
DateTime dt = (DateTime.Now.DateString() + " " + Text).ToDateTime(DateTimeEx.DateFormat + " " + timeFormat); DateTime dt = (DateTime.Now.DateString() + " " + Text).ToDateTime(DateTimeEx.DateFormat + " " + timeFormat);
Value = dt; if (Value != dt) Value = dt;
} }
catch catch
{ {
@ -92,8 +92,7 @@ namespace Sunny.UI
try try
{ {
DateTime dt = (DateTime.Now.DateString() + " " + Text).ToDateTime(DateTimeEx.DateFormat + " " + timeFormat); DateTime dt = (DateTime.Now.DateString() + " " + Text).ToDateTime(DateTimeEx.DateFormat + " " + timeFormat);
if (Value != dt) if (Value != dt) Value = dt;
Value = dt;
} }
catch catch
{ {