diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index d4a97f5b..24ddd6f4 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 de69ba01..333fc11d 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 d46051b3..c94a62c7 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 37d21c1e..1b2eec74 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 2e2717a2..f8f6eb12 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Demo/FMain.Designer.cs b/SunnyUI.Demo/FMain.Designer.cs index a7e412b4..9e563d76 100644 --- a/SunnyUI.Demo/FMain.Designer.cs +++ b/SunnyUI.Demo/FMain.Designer.cs @@ -109,6 +109,7 @@ this.Name = "FMain"; this.Padding = new System.Windows.Forms.Padding(2, 35, 2, 2); this.ShowDragStretch = true; + this.ShowIcon = true; this.ShowRadius = false; this.ShowShadow = true; this.Text = "SunnyUI.Net"; diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 2ce241d0..bc3cd114 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -857,7 +857,7 @@ namespace Sunny.UI e.Graphics.SetDefaultQuality(); - if (ShowIcon && Icon != null) + if (ShowTitleIcon && Icon != null) { e.Graphics.DrawImage(Icon.ToBitmap(), 6, (TitleHeight - 24) / 2, 24, 24); } @@ -869,7 +869,21 @@ namespace Sunny.UI } else { - e.Graphics.DrawString(Text, Font, titleForeColor, 6 + (ShowIcon && Icon != null ? 26 : 0), (TitleHeight - sf.Height) / 2); + e.Graphics.DrawString(Text, Font, titleForeColor, 6 + (ShowTitleIcon && Icon != null ? 26 : 0), (TitleHeight - sf.Height) / 2); + } + } + + private bool showTitleIcon = false; + + [Description("显示标题栏图标"), Category("SunnyUI")] + [DefaultValue(false)] + public bool ShowTitleIcon + { + get => showTitleIcon; + set + { + showTitleIcon = value; + Invalidate(); } } diff --git a/SunnyUI/Forms/UIForm.resx b/SunnyUI/Forms/UIForm.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/SunnyUI/Forms/UIForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file