diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 764100ee..4a4e25cb 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 7cc9d3e9..eb6e12cb 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/Bin/net45/SunnyUI.dll b/Bin/net45/SunnyUI.dll index 8bf38f42..6d6ba674 100644 Binary files a/Bin/net45/SunnyUI.dll and b/Bin/net45/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll index 633f9eba..8abbfd11 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/ref/SunnyUI.dll b/Bin/net5.0-windows/ref/SunnyUI.dll index eb1c2c8d..bed9e61d 100644 Binary files a/Bin/net5.0-windows/ref/SunnyUI.dll and b/Bin/net5.0-windows/ref/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index 09c3b6ba..4042eae6 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FFlowLayoutPanel.cs b/SunnyUI.Demo/Controls/FFlowLayoutPanel.cs index e5122212..587b4966 100644 --- a/SunnyUI.Demo/Controls/FFlowLayoutPanel.cs +++ b/SunnyUI.Demo/Controls/FFlowLayoutPanel.cs @@ -28,10 +28,10 @@ Text = "Button" + index++.ToString("D2") }; - //可以用原生方法Controls.Add - uiFlowLayoutPanel1.Controls.Add(btn); - //或者封装的方法Add - //uiFlowLayoutPanel1.Add(btn); + //建议用封装的方法Add + uiFlowLayoutPanel1.Add(btn); + //也可以用原生方法Controls.Add(不推荐) + //uiFlowLayoutPanel1.Controls.Add(btn); uiButton3.Enabled = true; } diff --git a/SunnyUI/Controls/UIFlowLayoutPanel.cs b/SunnyUI/Controls/UIFlowLayoutPanel.cs index 57658f71..2e60093f 100644 --- a/SunnyUI/Controls/UIFlowLayoutPanel.cs +++ b/SunnyUI/Controls/UIFlowLayoutPanel.cs @@ -24,7 +24,6 @@ using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; -using System.Windows.Forms.Layout; namespace Sunny.UI { @@ -65,11 +64,6 @@ namespace Sunny.UI timer.Stop(); } - public override LayoutEngine LayoutEngine - { - get { return Panel.LayoutEngine; } - } - [DefaultValue(System.Windows.Forms.FlowDirection.LeftToRight)] [Localizable(true)] public FlowDirection FlowDirection diff --git a/SunnyUI/Controls/UIImageListBox.cs b/SunnyUI/Controls/UIImageListBox.cs index c5ca8b46..94260eaf 100644 --- a/SunnyUI/Controls/UIImageListBox.cs +++ b/SunnyUI/Controls/UIImageListBox.cs @@ -362,20 +362,20 @@ namespace Sunny.UI } } - protected override void WndProc(ref Message m) - { - if (IsDisposed || Disposing) return; - if (IsHandleCreated) - { - if (m.Msg == Win32.User.WM_ERASEBKGND) - { - m.Result = IntPtr.Zero; - return; - } - } - - base.WndProc(ref m); - } + //protected override void WndProc(ref Message m) + //{ + // if (IsDisposed || Disposing) return; + // if (IsHandleCreated) + // { + // if (m.Msg == Win32.User.WM_ERASEBKGND) + // { + // m.Result = IntPtr.Zero; + // return; + // } + // } + // + // base.WndProc(ref m); + //} public ImageListBox() { diff --git a/SunnyUI/Controls/UIListBox.cs b/SunnyUI/Controls/UIListBox.cs index f1b7e7fb..f32f4d61 100644 --- a/SunnyUI/Controls/UIListBox.cs +++ b/SunnyUI/Controls/UIListBox.cs @@ -607,11 +607,11 @@ namespace Sunny.UI ItemsInsert?.Invoke(this, EventArgs.Empty); } - if (m.Msg == Win32.User.WM_ERASEBKGND) - { - m.Result = IntPtr.Zero; - return; - } + //if (m.Msg == Win32.User.WM_ERASEBKGND) + //{ + // m.Result = IntPtr.Zero; + // return; + //} } base.WndProc(ref m); diff --git a/SunnyUI/Controls/UITransfer.cs b/SunnyUI/Controls/UITransfer.cs index ce167e46..c3f8ec13 100644 --- a/SunnyUI/Controls/UITransfer.cs +++ b/SunnyUI/Controls/UITransfer.cs @@ -46,6 +46,14 @@ namespace Sunny.UI l2.ItemsCountChange += L2_ItemsCountChange; } + [DefaultValue(true)] + [Description("显示多选按钮"), Category("SunnyUI")] + public bool ShowMulti + { + get => b1.Visible; + set => b1.Visible = b4.Visible = value; + } + private void L2_ItemsCountChange(object sender, EventArgs e) { ItemsRightCountChange?.Invoke(this, e); @@ -84,12 +92,17 @@ namespace Sunny.UI [Browsable(false)] public ListBox ListBoxRight => l2.ListBox; + public delegate void ItemChange(object sender, object item); + + public event ItemChange ItemAdd; + public event ItemChange ItemRemove; private void b1_Click(object sender, EventArgs e) { foreach (object item in l1.Items) { l2.Items.Add(item); + ItemAdd?.Invoke(this, item); } l1.Items.Clear(); @@ -106,6 +119,7 @@ namespace Sunny.UI int idx = l1.SelectedIndex; object item = l1.SelectedItem; l2.Items.Add(item); + ItemAdd?.Invoke(this, item); l1.Items.Remove(item); if (l2.Items.Count > 0) @@ -132,6 +146,7 @@ namespace Sunny.UI int idx = l2.SelectedIndex; object item = l2.SelectedItem; l1.Items.Add(item); + ItemRemove?.Invoke(this, item); l2.Items.Remove(item); if (l1.Items.Count > 0) @@ -156,6 +171,7 @@ namespace Sunny.UI foreach (object item in l2.Items) { l1.Items.Add(item); + ItemRemove?.Invoke(this, item); } l2.Items.Clear();