diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 4f76f4f0..53cec2ee 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 8b20c710..b62a2328 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 7d92a66d..8d29809d 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 6f5f48b0..852e25d0 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 37d8c117..fc6c0fb4 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 58c379cb..43a09414 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 b0ae7614..e5122212 100644 --- a/SunnyUI.Demo/Controls/FFlowLayoutPanel.cs +++ b/SunnyUI.Demo/Controls/FFlowLayoutPanel.cs @@ -23,8 +23,11 @@ UIButton btn; private void uiButton1_Click(object sender, System.EventArgs e) { - btn = new UIButton(); - btn.Text = "Button" + index++.ToString("D2"); + btn = new UIButton + { + Text = "Button" + index++.ToString("D2") + }; + //可以用原生方法Controls.Add uiFlowLayoutPanel1.Controls.Add(btn); //或者封装的方法Add diff --git a/SunnyUI.Demo/Forms/FDialogs.cs b/SunnyUI.Demo/Forms/FDialogs.cs index a09a46ae..05783d1c 100644 --- a/SunnyUI.Demo/Forms/FDialogs.cs +++ b/SunnyUI.Demo/Forms/FDialogs.cs @@ -166,11 +166,14 @@ namespace Sunny.UI.Demo private void uiSymbolButton3_Click(object sender, EventArgs e) { - UILoginForm frm = new UILoginForm(); - frm.ShowInTaskbar = true; - frm.Text = "Login"; - frm.Title = "SunnyUI.Net Login Form"; - frm.SubText = Version; + UILoginForm frm = new UILoginForm + { + ShowInTaskbar = true, + Text = "Login", + Title = "SunnyUI.Net Login Form", + SubText = Version + }; + frm.OnLogin += Frm_OnLogin; frm.LoginImage = UILoginForm.UILoginImage.Login2; frm.ShowDialog(); diff --git a/SunnyUI/Controls/UIImageListBox.cs b/SunnyUI/Controls/UIImageListBox.cs index 0fcf4748..85af59b3 100644 --- a/SunnyUI/Controls/UIImageListBox.cs +++ b/SunnyUI/Controls/UIImageListBox.cs @@ -67,6 +67,16 @@ namespace Sunny.UI listbox.MouseMove += Listbox_MouseMove; } + public int IndexFromPoint(Point p) + { + return listbox.IndexFromPoint(p); + } + + public int IndexFromPoint(int x, int y) + { + return listbox.IndexFromPoint(x, y); + } + protected override void AfterSetFillColor(Color color) { base.AfterSetFillColor(color); diff --git a/SunnyUI/Controls/UIListBox.cs b/SunnyUI/Controls/UIListBox.cs index 2b542784..6c04eddf 100644 --- a/SunnyUI/Controls/UIListBox.cs +++ b/SunnyUI/Controls/UIListBox.cs @@ -77,6 +77,16 @@ namespace Sunny.UI [Browsable(false)] public ListBox ListBox => listbox; + public int IndexFromPoint(Point p) + { + return listbox.IndexFromPoint(p); + } + + public int IndexFromPoint(int x, int y) + { + return listbox.IndexFromPoint(x, y); + } + [DefaultValue(StringAlignment.Near)] [Description("列表项高度"), Category("SunnyUI")] public new StringAlignment TextAlignment @@ -100,7 +110,6 @@ namespace Sunny.UI get => listbox.SelectedIndices; } - protected override void OnContextMenuStripChanged(EventArgs e) { base.OnContextMenuStripChanged(e);