diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe
index 2b12acaf..b82d308a 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 0cb94008..fa05d8f2 100644
Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ
diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll
index bdab72d5..b5de3833 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 dcef2def..b82a14fe 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 6c6f5c24..eb263cc7 100644
Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ
diff --git a/SunnyUI.Net5.Demo/Program.cs b/SunnyUI.Net5.Demo/Program.cs
index 2f1c3d9b..073a8164 100644
--- a/SunnyUI.Net5.Demo/Program.cs
+++ b/SunnyUI.Net5.Demo/Program.cs
@@ -11,7 +11,7 @@ namespace Sunny.UI.Demo
[STAThread]
static void Main()
{
- Application.SetHighDpiMode(HighDpiMode.SystemAware);
+ Application.SetHighDpiMode(HighDpiMode.DpiUnawareGdiScaled);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FMain());
diff --git a/SunnyUI.Net5.Demo/SunnyUI.Net5.Demo.csproj b/SunnyUI.Net5.Demo/SunnyUI.Net5.Demo.csproj
index 8cf9663f..5614b736 100644
--- a/SunnyUI.Net5.Demo/SunnyUI.Net5.Demo.csproj
+++ b/SunnyUI.Net5.Demo/SunnyUI.Net5.Demo.csproj
@@ -24,7 +24,7 @@
-
+
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
index 2cddc8fb..95fbbfa1 100644
--- 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
@@ -8,20 +8,20 @@
".NETCoreApp,Version=v5.0": {
"SunnyUI.Net5.Demo/3.0.1": {
"dependencies": {
- "SunnyUI": "3.0.0"
+ "SunnyUI": "3.0.1"
},
"runtime": {
"SunnyUI.Net5.Demo.dll": {}
}
},
- "SunnyUI/3.0.0": {
+ "SunnyUI/3.0.1": {
"dependencies": {
"SunnyUI.Common": "3.0.0"
},
"runtime": {
"lib/net5.0-windows7.0/SunnyUI.dll": {
- "assemblyVersion": "3.0.0.0",
- "fileVersion": "3.0.0.0"
+ "assemblyVersion": "3.0.1.0",
+ "fileVersion": "3.0.1.0"
}
}
},
@@ -41,12 +41,12 @@
"serviceable": false,
"sha512": ""
},
- "SunnyUI/3.0.0": {
+ "SunnyUI/3.0.1": {
"type": "package",
"serviceable": true,
- "sha512": "sha512-evxpOlq6cuG+Dv2sYm5Ssc22acA1HwGLRBg8wTPYHqeaKhwtlgPfXG10ZOsNUIHyBK4ZVfawUtm7iDQUEcU0Ew==",
- "path": "sunnyui/3.0.0",
- "hashPath": "sunnyui.3.0.0.nupkg.sha512"
+ "sha512": "sha512-M92GbvBBNecHBVGZNnrX/Ual9hLC9bMts3T/PAizPFaFpBGdpgr7jbkRUi3D0VFe/mbBYJDhhY5/gw51tAONiQ==",
+ "path": "sunnyui/3.0.1",
+ "hashPath": "sunnyui.3.0.1.nupkg.sha512"
},
"SunnyUI.Common/3.0.0": {
"type": "package",
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
index 56bec57f..1e382444 100644
Binary files a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.dll 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.runtimeconfig.dev.json b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.Net5.Demo.runtimeconfig.dev.json
index 14df11c9..cc6de40e 100644
--- 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
@@ -1,9 +1,8 @@
{
"runtimeOptions": {
"additionalProbingPaths": [
- "C:\\Users\\Sunny\\.dotnet\\store\\|arch|\\|tfm|",
- "C:\\Users\\Sunny\\.nuget\\packages",
- "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
+ "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.dll b/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.dll
index 3cf221de..3df23e84 100644
Binary files a/SunnyUI.Net5.Demo/bin/net5.0-windows/SunnyUI.dll 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
index adec4d32..2295355e 100644
Binary files a/SunnyUI.Net5.Demo/bin/net5.0-windows/ref/SunnyUI.Net5.Demo.dll 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 b3fad8f4..fcac0eeb 100644
--- a/SunnyUI/Controls/UIListBox.cs
+++ b/SunnyUI/Controls/UIListBox.cs
@@ -313,6 +313,77 @@ namespace Sunny.UI
_style = UIStyle.Custom;
}
}
+
+ [DefaultValue("")]
+ [Description("指示要为此控件中的项显示的属性")]
+ [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
+ [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
+ public string DisplayMember
+ {
+ get => listbox.DisplayMember;
+ set => listbox.DisplayMember = value;
+ }
+
+ [DefaultValue("")]
+ [Description("指示用作控件中项的实际值的属性")]
+ [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
+ public string ValueMember
+ {
+ get => listbox.ValueMember;
+ set => listbox.ValueMember = value;
+ }
+
+ [DefaultValue(null)]
+ [RefreshProperties(RefreshProperties.Repaint)]
+ [AttributeProvider(typeof(IListSource))]
+ [Description("指示此控件将用来获取其项的列表")]
+ public object DataSource
+ {
+ get => listbox.DataSource;
+ set => listbox.DataSource = value;
+ }
+
+ private void Box_ValueMemberChanged(object sender, EventArgs e)
+ {
+ ValueMemberChanged?.Invoke(sender, e);
+ }
+
+ private void Box_DisplayMemberChanged(object sender, EventArgs e)
+ {
+ DisplayMemberChanged?.Invoke(sender, e);
+ }
+
+ private void Box_DataSourceChanged(object sender, EventArgs e)
+ {
+ DataSourceChanged?.Invoke(sender, e);
+ }
+
+ public event EventHandler DataSourceChanged;
+
+ public event EventHandler DisplayMemberChanged;
+
+ public event EventHandler ValueMemberChanged;
+
+ [DefaultValue(null)]
+ [Description("格式说明符,指示显示值的方式")]
+ public string FormatString
+ {
+ get => listbox.FormatString;
+ set => listbox.FormatString = value;
+ }
+
+ [Description("获取或设置指示显示值是否可以进行格式化操作。"), Category("SunnyUI")]
+ [DefaultValue(false)]
+ public bool FormattingEnabled
+ {
+ get => listbox.FormattingEnabled;
+ set => listbox.FormattingEnabled = value;
+ }
+
+ public string GetItemText(object item)
+ {
+ return listbox.GetItemText(item);
+ }
}
///