diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index bbb495f7..360e8ce8 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 5807e010..069c289c 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 35ffbcbd..3a8002b7 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 90acfd05..e11f0006 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 b38299b2..625097c2 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Common.dll b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Common.dll new file mode 100644 index 00000000..6741d9f0 Binary files /dev/null and b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Common.dll differ diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.deps.json b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.deps.json new file mode 100644 index 00000000..beb7d423 --- /dev/null +++ b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.deps.json @@ -0,0 +1,59 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v5.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v5.0": { + "SunnyUI.Net5.Demo/3.0.5": { + "dependencies": { + "SunnyUI": "3.0.5" + }, + "runtime": { + "SunnyUI.Net5.Demo.dll": {} + } + }, + "SunnyUI/3.0.5": { + "dependencies": { + "SunnyUI.Common": "3.0.5" + }, + "runtime": { + "lib/net5.0-windows7.0/SunnyUI.dll": { + "assemblyVersion": "3.0.5.0", + "fileVersion": "3.0.5.0" + } + } + }, + "SunnyUI.Common/3.0.5": { + "runtime": { + "lib/net5.0/SunnyUI.Common.dll": { + "assemblyVersion": "3.0.5.0", + "fileVersion": "3.0.5.0" + } + } + } + } + }, + "libraries": { + "SunnyUI.Net5.Demo/3.0.5": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "SunnyUI/3.0.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-0+U39GWGWBQFmoZom+UOzuST9FxsbUol5RWZgnBLzfGDlR+O4C72HjQ38u9G/SppWBswr5+dmGvFYHBA2HS4uQ==", + "path": "sunnyui/3.0.5", + "hashPath": "sunnyui.3.0.5.nupkg.sha512" + }, + "SunnyUI.Common/3.0.5": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bP9fQW8P4fJAV6FfU2Xfw3MtOduLoj/j+MRfdIn3eq9bGqDepg/w5/xqXi393Vuxvxk24eY9+5YMRVyeS+tiRg==", + "path": "sunnyui.common/3.0.5", + "hashPath": "sunnyui.common.3.0.5.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.dll b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.dll new file mode 100644 index 00000000..27dca2cf Binary files /dev/null and b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.dll differ diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.exe b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.exe new file mode 100644 index 00000000..ca410760 Binary files /dev/null and b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.exe differ diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.dev.json b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.dev.json new file mode 100644 index 00000000..cc6de40e --- /dev/null +++ b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.dev.json @@ -0,0 +1,8 @@ +{ + "runtimeOptions": { + "additionalProbingPaths": [ + "C:\\Users\\Administrator\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\Administrator\\.nuget\\packages" + ] + } +} \ No newline at end of file diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.json b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.json new file mode 100644 index 00000000..dae617c0 --- /dev/null +++ b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.json @@ -0,0 +1,9 @@ +{ + "runtimeOptions": { + "tfm": "net5.0", + "framework": { + "name": "Microsoft.WindowsDesktop.App", + "version": "5.0.0" + } + } +} \ No newline at end of file diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.dll b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.dll new file mode 100644 index 00000000..6945d7f3 Binary files /dev/null and b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.dll differ diff --git a/SunnyUI.Net5.Demo/bin/net5.0-windows/ref/SunnyUI.Net5.Demo.dll b/SunnyUI.Net5.Demo/bin/net5.0-windows/ref/SunnyUI.Net5.Demo.dll new file mode 100644 index 00000000..87cb2778 Binary files /dev/null and b/SunnyUI.Net5.Demo/bin/net5.0-windows/ref/SunnyUI.Net5.Demo.dll differ diff --git a/SunnyUI/Controls/UIListBox.cs b/SunnyUI/Controls/UIListBox.cs index b6c65666..0bde3b71 100644 --- a/SunnyUI/Controls/UIListBox.cs +++ b/SunnyUI/Controls/UIListBox.cs @@ -27,6 +27,7 @@ using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; +using static System.Windows.Forms.ListBox; namespace Sunny.UI { @@ -84,6 +85,22 @@ namespace Sunny.UI set => listbox.TextAlignment = value; } + [DefaultValue(SelectionMode.One)] + [Description("选择项所用方法"), Category("SunnyUI")] + public SelectionMode SelectionMode + { + get => listbox.SelectionMode; + set => listbox.SelectionMode = value; + } + + [DefaultValue(SelectionMode.One)] + [Description("选择项所用方法"), Category("SunnyUI")] + public SelectedIndexCollection SelectedIndices + { + get => listbox.SelectedIndices; + } + + protected override void OnContextMenuStripChanged(EventArgs e) { base.OnContextMenuStripChanged(e); @@ -737,12 +754,14 @@ namespace Sunny.UI protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); + if (SelectionMode != SelectionMode.One) return; MouseIndex = IndexFromPoint(e.Location); } protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); + if (SelectionMode != SelectionMode.One) return; MouseIndex = -1; } }