diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index bb334d22..b5c7601a 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/Bin/SunnyUI.pdb b/Bin/SunnyUI.pdb index 2c23cf05..32c7120d 100644 Binary files a/Bin/SunnyUI.pdb and b/Bin/SunnyUI.pdb differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe index f7b47f78..9c7e11d3 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe and b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.dll b/SunnyUI.Demo/Bin/SunnyUI.dll index bb334d22..b5c7601a 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.dll and b/SunnyUI.Demo/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FCombobox.Designer.cs b/SunnyUI.Demo/Controls/FCombobox.Designer.cs index 8079d6b3..116ffa4b 100644 --- a/SunnyUI.Demo/Controls/FCombobox.Designer.cs +++ b/SunnyUI.Demo/Controls/FCombobox.Designer.cs @@ -82,6 +82,7 @@ this.uiDatetimePicker1.Text = "2020-06-02 17:57:28"; this.uiDatetimePicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiDatetimePicker1.Value = new System.DateTime(2020, 6, 2, 17, 57, 28, 203); + this.uiDatetimePicker1.ValueChanged += new Sunny.UI.UIDatetimePicker.OnDateTimeChanged(this.uiDatetimePicker1_ValueChanged); // // uiColorPicker1 // @@ -138,6 +139,7 @@ this.uiTimePicker1.Text = "23:41:39"; this.uiTimePicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiTimePicker1.Value = new System.DateTime(2020, 5, 29, 23, 41, 39, 684); + this.uiTimePicker1.ValueChanged += new Sunny.UI.UITimePicker.OnDateTimeChanged(this.uiTimePicker1_ValueChanged); // // uiLine3 // @@ -178,6 +180,7 @@ this.uiDatePicker1.Text = "2020-04-16"; this.uiDatePicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiDatePicker1.Value = new System.DateTime(2020, 4, 16, 0, 0, 0, 0); + this.uiDatePicker1.ValueChanged += new Sunny.UI.UIDatePicker.OnDateTimeChanged(this.uiDatePicker1_ValueChanged); // // uiComboBox2 // diff --git a/SunnyUI.Demo/Controls/FCombobox.cs b/SunnyUI.Demo/Controls/FCombobox.cs index 3a405f67..e4df333c 100644 --- a/SunnyUI.Demo/Controls/FCombobox.cs +++ b/SunnyUI.Demo/Controls/FCombobox.cs @@ -7,9 +7,21 @@ namespace Sunny.UI.Demo public FCombobox() { InitializeComponent(); - uiDatePicker1.Value = DateTime.Today; - uiTimePicker1.Value = DateTime.Now; - uiDatetimePicker1.Value = DateTime.Now; + } + + private void uiDatePicker1_ValueChanged(object sender, DateTime value) + { + uiDatePicker1.Value.ConsoleWriteLine(); + } + + private void uiDatetimePicker1_ValueChanged(object sender, DateTime value) + { + uiDatetimePicker1.Value.ConsoleWriteLine(); + } + + private void uiTimePicker1_ValueChanged(object sender, DateTime value) + { + uiTimePicker1.Value.ConsoleWriteLine(); } } } diff --git a/SunnyUI/Controls/DropItem/UITimeItem.cs b/SunnyUI/Controls/DropItem/UITimeItem.cs index 593aac05..14365c1e 100644 --- a/SunnyUI/Controls/DropItem/UITimeItem.cs +++ b/SunnyUI/Controls/DropItem/UITimeItem.cs @@ -547,7 +547,7 @@ namespace Sunny.UI private void btnOK_Click(object sender, EventArgs e) { - time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, Hour, Minute, Second); + time = new DateTime(DateTime.MinValue.Year, DateTime.MinValue.Month, DateTime.MinValue.Day, Hour, Minute, Second); DoValueChanged(this, time); CloseParent(); } diff --git a/SunnyUI/Controls/UIDatePicker.cs b/SunnyUI/Controls/UIDatePicker.cs index 981b0c8a..9bee9d04 100644 --- a/SunnyUI/Controls/UIDatePicker.cs +++ b/SunnyUI/Controls/UIDatePicker.cs @@ -25,6 +25,8 @@ using System.ComponentModel; namespace Sunny.UI { [ToolboxItem(true)] + [DefaultProperty("Value")] + [DefaultEvent("ValueChanged")] public sealed partial class UIDatePicker : UIDropControl { public delegate void OnDateTimeChanged(object sender, DateTime value); diff --git a/SunnyUI/Controls/UIDateTimePicker.cs b/SunnyUI/Controls/UIDateTimePicker.cs index 2587ffad..34f37eac 100644 --- a/SunnyUI/Controls/UIDateTimePicker.cs +++ b/SunnyUI/Controls/UIDateTimePicker.cs @@ -5,6 +5,8 @@ using System.Windows.Forms; namespace Sunny.UI { [ToolboxItem(true)] + [DefaultProperty("Value")] + [DefaultEvent("ValueChanged")] public sealed partial class UIDatetimePicker : UIDropControl { private void InitializeComponent() diff --git a/SunnyUI/Controls/UITimePicker.cs b/SunnyUI/Controls/UITimePicker.cs index 62ede806..c275f4b6 100644 --- a/SunnyUI/Controls/UITimePicker.cs +++ b/SunnyUI/Controls/UITimePicker.cs @@ -26,6 +26,8 @@ using System.Windows.Forms; namespace Sunny.UI { [ToolboxItem(true)] + [DefaultProperty("Value")] + [DefaultEvent("ValueChanged")] public sealed partial class UITimePicker : UIDropControl { private void InitializeComponent()