diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index efb7031a..fd3b9641 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index 380154a1..b925a921 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FProcess.cs b/SunnyUI.Demo/Controls/FProcess.cs index d84dbe42..da45768a 100644 --- a/SunnyUI.Demo/Controls/FProcess.cs +++ b/SunnyUI.Demo/Controls/FProcess.cs @@ -22,5 +22,20 @@ uiProcessBar2.Value = uiProcessBar1.Value = value; uiProcessBar3.Value = uiRoundProcess2.Value = uiRoundProcess1.Value = value; } + + private void uiTrackBar1_ValueChanged(object sender, System.EventArgs e) + { + + } + + private void uiTrackBar3_ValueChanged(object sender, System.EventArgs e) + { + uiTrackBar4.Value = uiTrackBar3.Value; + } + + private void uiTrackBar4_ValueChanged(object sender, System.EventArgs e) + { + uiTrackBar5.Value = uiTrackBar4.Value; + } } } diff --git a/SunnyUI.Demo/Controls/FProcess.designer.cs b/SunnyUI.Demo/Controls/FProcess.designer.cs index b21af005..45bd8dbc 100644 --- a/SunnyUI.Demo/Controls/FProcess.designer.cs +++ b/SunnyUI.Demo/Controls/FProcess.designer.cs @@ -118,6 +118,7 @@ namespace Sunny.UI.Demo this.uiTrackBar4.Size = new System.Drawing.Size(158, 29); this.uiTrackBar4.TabIndex = 98; this.uiTrackBar4.Text = "uiTrackBar4"; + this.uiTrackBar4.ValueChanged += new System.EventHandler(this.uiTrackBar4_ValueChanged); // // uiTrackBar3 // @@ -129,6 +130,7 @@ namespace Sunny.UI.Demo this.uiTrackBar3.Size = new System.Drawing.Size(158, 29); this.uiTrackBar3.TabIndex = 97; this.uiTrackBar3.Text = "uiTrackBar3"; + this.uiTrackBar3.ValueChanged += new System.EventHandler(this.uiTrackBar3_ValueChanged); // // uiTrackBar2 // @@ -146,6 +148,7 @@ namespace Sunny.UI.Demo // uiLine2 // this.uiLine2.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine2.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine2.Location = new System.Drawing.Point(29, 287); this.uiLine2.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine2.Name = "uiLine2"; @@ -192,6 +195,7 @@ namespace Sunny.UI.Demo // uiLine9 // this.uiLine9.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine9.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine9.Location = new System.Drawing.Point(29, 147); this.uiLine9.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine9.Name = "uiLine9"; @@ -227,6 +231,7 @@ namespace Sunny.UI.Demo // uiLine1 // this.uiLine1.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine1.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine1.Location = new System.Drawing.Point(381, 54); this.uiLine1.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine1.Name = "uiLine1"; @@ -248,6 +253,7 @@ namespace Sunny.UI.Demo // uiLine5 // this.uiLine5.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine5.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine5.Location = new System.Drawing.Point(28, 369); this.uiLine5.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine5.Name = "uiLine5"; @@ -266,10 +272,12 @@ namespace Sunny.UI.Demo this.uiTrackBar1.Size = new System.Drawing.Size(158, 29); this.uiTrackBar1.TabIndex = 86; this.uiTrackBar1.Text = "uiTrackBar1"; + this.uiTrackBar1.ValueChanged += new System.EventHandler(this.uiTrackBar1_ValueChanged); // // uiLine4 // this.uiLine4.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine4.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine4.Location = new System.Drawing.Point(381, 147); this.uiLine4.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine4.Name = "uiLine4"; @@ -291,6 +299,7 @@ namespace Sunny.UI.Demo // uiLine3 // this.uiLine3.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine3.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine3.Location = new System.Drawing.Point(30, 54); this.uiLine3.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine3.Name = "uiLine3"; @@ -327,6 +336,7 @@ namespace Sunny.UI.Demo // uiLine6 // this.uiLine6.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiLine6.LineDashStyle = Sunny.UI.UILineDashStyle.None; this.uiLine6.Location = new System.Drawing.Point(527, 287); this.uiLine6.MinimumSize = new System.Drawing.Size(16, 16); this.uiLine6.Name = "uiLine6"; diff --git a/SunnyUI/Controls/UIComboboxEx.cs b/SunnyUI/Controls/UIComboboxEx.cs index 33e52227..2350f9f7 100644 --- a/SunnyUI/Controls/UIComboboxEx.cs +++ b/SunnyUI/Controls/UIComboboxEx.cs @@ -26,6 +26,7 @@ using System.Windows.Forms; namespace Sunny.UI { + [ToolboxItem(false)] public class UIComboboxEx : ComboBox, IStyleInterface { public UIComboboxEx() diff --git a/SunnyUI/Controls/UIDatePicker.cs b/SunnyUI/Controls/UIDatePicker.cs index 554b6ae1..48e17d48 100644 --- a/SunnyUI/Controls/UIDatePicker.cs +++ b/SunnyUI/Controls/UIDatePicker.cs @@ -125,9 +125,7 @@ namespace Sunny.UI protected override void ItemForm_ValueChanged(object sender, object value) { Value = (DateTime)value; - Text = Value.ToString(dateFormat); Invalidate(); - ValueChanged?.Invoke(this, Value); } private readonly UIDateItem item = new UIDateItem(); @@ -146,7 +144,12 @@ namespace Sunny.UI if (value < new DateTime(1900, 1, 1)) value = new DateTime(1900, 1, 1); Text = value.ToString(dateFormat); - item.Date = value; + + if (item.Date != value) + { + item.Date = value; + ValueChanged?.Invoke(this, Value); + } } } diff --git a/SunnyUI/Controls/UIDateTimePicker.cs b/SunnyUI/Controls/UIDateTimePicker.cs index 2a100eec..64e0117f 100644 --- a/SunnyUI/Controls/UIDateTimePicker.cs +++ b/SunnyUI/Controls/UIDateTimePicker.cs @@ -116,9 +116,7 @@ namespace Sunny.UI protected override void ItemForm_ValueChanged(object sender, object value) { Value = (DateTime)value; - Text = Value.ToString(dateFormat); Invalidate(); - ValueChanged?.Invoke(this, Value); } private readonly UIDateTimeItem item = new UIDateTimeItem(); @@ -137,7 +135,12 @@ namespace Sunny.UI if (value < new DateTime(1900, 1, 1)) value = new DateTime(1900, 1, 1); Text = value.ToString(dateFormat); - item.Date = value; + + if (item.Date != value) + { + item.Date = value; + ValueChanged?.Invoke(this, Value); + } } } diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index 892bcc97..b3edf1c9 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -1228,7 +1228,7 @@ namespace Sunny.UI get => btn.ForeHoverColor; set { - btn.ForeHoverColor = value; + btn.SymbolHoverColor = btn.ForeHoverColor = value; _style = UIStyle.Custom; } } @@ -1264,7 +1264,7 @@ namespace Sunny.UI get => btn.ForePressColor; set { - btn.ForePressColor = value; + btn.SymbolPressColor = btn.ForePressColor = value; _style = UIStyle.Custom; } } diff --git a/SunnyUI/Controls/UITimePicker.cs b/SunnyUI/Controls/UITimePicker.cs index 9801c466..fed6bbff 100644 --- a/SunnyUI/Controls/UITimePicker.cs +++ b/SunnyUI/Controls/UITimePicker.cs @@ -107,9 +107,7 @@ namespace Sunny.UI protected override void ItemForm_ValueChanged(object sender, object value) { Value = (DateTime)value; - Text = Value.ToString(timeFormat); Invalidate(); - ValueChanged?.Invoke(this, Value); } private readonly UITimeItem item = new UITimeItem(); @@ -126,7 +124,11 @@ namespace Sunny.UI set { Text = value.ToString(timeFormat); - item.Time = value; + if (item.Time != value) + { + item.Time = value; + ValueChanged?.Invoke(this, Value); + } } }