This commit is contained in:
Sunny 2022-04-03 13:17:47 +08:00
parent 4fb03a6fcb
commit 51c378f3e2
10 changed files with 98 additions and 89 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -51,7 +51,7 @@
this.Aside.ItemHeight = 36; this.Aside.ItemHeight = 36;
this.Aside.LineColor = System.Drawing.Color.Black; this.Aside.LineColor = System.Drawing.Color.Black;
this.Aside.Location = new System.Drawing.Point(2, 145); this.Aside.Location = new System.Drawing.Point(2, 145);
this.Aside.MenuStyle = Sunny.UI.UIMenuStyle.Black; this.Aside.MenuStyle = Sunny.UI.UIMenuStyle.Custom;
this.Aside.ScrollBarColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); this.Aside.ScrollBarColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.Aside.ScrollBarHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); this.Aside.ScrollBarHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
this.Aside.ScrollBarPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); this.Aside.ScrollBarPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
@ -118,7 +118,9 @@
// //
// uiContextMenuStrip1 // uiContextMenuStrip1
// //
this.uiContextMenuStrip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
this.uiContextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiContextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiContextMenuStrip1.IsScaled = true;
this.uiContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.uiContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem1}); this.ToolStripMenuItem1});

View File

@ -21,8 +21,7 @@ namespace Sunny.UI.Demo
person.Birthday = new DateTime(2002, 1, 1); person.Birthday = new DateTime(2002, 1, 1);
FEdit frm = new FEdit(); FEdit frm = new FEdit();
frm.ReSetDPIScale(); frm.Render();
frm.Style = UIStyles.Style;
frm.Person = person; frm.Person = person;
frm.ShowDialog(); frm.ShowDialog();
if (frm.IsOK) if (frm.IsOK)
@ -36,8 +35,7 @@ namespace Sunny.UI.Demo
private void btnAdd_Click(object sender, EventArgs e) private void btnAdd_Click(object sender, EventArgs e)
{ {
FEdit frm = new FEdit(); FEdit frm = new FEdit();
frm.ReSetDPIScale(); frm.Render();
frm.Style = UIStyles.Style;
frm.ShowDialogWithMask(); frm.ShowDialogWithMask();
if (frm.IsOK) if (frm.IsOK)
{ {
@ -89,8 +87,7 @@ namespace Sunny.UI.Demo
option.AddComboCheckedListBox("checkedList", "选择", checkedItems, "CCC"); option.AddComboCheckedListBox("checkedList", "选择", checkedItems, "CCC");
UIEditForm frm = new UIEditForm(option); UIEditForm frm = new UIEditForm(option);
frm.ReSetDPIScale(); frm.Render();
frm.Style = UIStyles.Style;
frm.CheckedData += Frm_CheckedData; frm.CheckedData += Frm_CheckedData;
frm.ShowDialog(); frm.ShowDialog();

View File

@ -38,8 +38,8 @@
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="SunnyUI, Version=3.1.2.1, Culture=neutral, PublicKeyToken=27d7d2e821d97aeb, processorArchitecture=MSIL"> <Reference Include="SunnyUI, Version=3.1.3.0, Culture=neutral, PublicKeyToken=27d7d2e821d97aeb, processorArchitecture=MSIL">
<HintPath>..\packages\SunnyUI.3.1.2.1\lib\net40\SunnyUI.dll</HintPath> <HintPath>..\packages\SunnyUI.3.1.3\lib\net40\SunnyUI.dll</HintPath>
</Reference> </Reference>
<Reference Include="SunnyUI.Common, Version=3.1.2.0, Culture=neutral, PublicKeyToken=5a271fb7ba597231, processorArchitecture=MSIL"> <Reference Include="SunnyUI.Common, Version=3.1.2.0, Culture=neutral, PublicKeyToken=5a271fb7ba597231, processorArchitecture=MSIL">
<HintPath>..\packages\SunnyUI.Common.3.1.2\lib\net40\SunnyUI.Common.dll</HintPath> <HintPath>..\packages\SunnyUI.Common.3.1.2\lib\net40\SunnyUI.Common.dll</HintPath>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="SunnyUI" version="3.1.2.1" targetFramework="net40" /> <package id="SunnyUI" version="3.1.3" targetFramework="net40" />
<package id="SunnyUI.Common" version="3.1.2" targetFramework="net40" /> <package id="SunnyUI.Common" version="3.1.2" targetFramework="net40" />
</packages> </packages>

View File

@ -29,7 +29,7 @@ namespace Sunny.UI
/// <summary> /// <summary>
/// 版本 /// 版本
/// </summary> /// </summary>
public const string Version = "SunnyUI.Net V3.1.2"; public const string Version = "SunnyUI.Net V3.1.3";
public const int EditorMinHeight = 20; public const int EditorMinHeight = 20;
public const int EditorMaxHeight = 60; public const int EditorMaxHeight = 60;

View File

@ -58,6 +58,7 @@ namespace Sunny.UI
/// </summary> /// </summary>
public UIStyleManager() public UIStyleManager()
{ {
Version = UIGlobal.Version;
} }
/// <summary> /// <summary>
@ -67,6 +68,7 @@ namespace Sunny.UI
public UIStyleManager(IContainer container) : this() public UIStyleManager(IContainer container) : this()
{ {
container.Add(this); container.Add(this);
Version = UIGlobal.Version;
} }
[DefaultValue(false), Description("DPI缩放"), Category("SunnyUI")] [DefaultValue(false), Description("DPI缩放"), Category("SunnyUI")]
@ -82,5 +84,13 @@ namespace Sunny.UI
get => UIStyles.FontSize; get => UIStyles.FontSize;
set => UIStyles.FontSize = value; set => UIStyles.FontSize = value;
} }
/// <summary>
/// 版本
/// </summary>
public string Version
{
get;
}
} }
} }

View File

@ -1,93 +1,93 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net5.0-windows;net472;net40</TargetFrameworks> <TargetFrameworks>net5.0-windows;net472;net40</TargetFrameworks>
<LangVersion>9.0</LangVersion> <LangVersion>9.0</LangVersion>
<ProjectGuid>{AB1CB247-E20B-4CBE-B269-570ADDD96C53}</ProjectGuid> <ProjectGuid>{AB1CB247-E20B-4CBE-B269-570ADDD96C53}</ProjectGuid>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<RootNamespace>Sunny.UI</RootNamespace> <RootNamespace>Sunny.UI</RootNamespace>
<Description>SunnyUI.Net 是基于.Net Framework 4.0+、.Net 5、.Net 6 框架的 C# WinForm 开源控件库、工具类库、扩展类库、多页面开发框架。</Description> <Description>SunnyUI.Net 是基于.Net Framework 4.0+、.Net 5、.Net 6 框架的 C# WinForm 开源控件库、工具类库、扩展类库、多页面开发框架。</Description>
<Copyright>CopyRight © SunnyUI.Net 2012-2022</Copyright> <Copyright>CopyRight © SunnyUI.Net 2012-2022</Copyright>
<PackageLicenseFile>LICENSE</PackageLicenseFile> <PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<Version>3.1.2.1</Version> <Version>3.1.3</Version>
<Authors>ShenYonghua</Authors> <Authors>ShenYonghua</Authors>
<Company>SunnyUI.Net</Company> <Company>SunnyUI.Net</Company>
<PackageId>SunnyUI</PackageId> <PackageId>SunnyUI</PackageId>
<PackageProjectUrl>https://gitee.com/yhuse/SunnyUI</PackageProjectUrl> <PackageProjectUrl>https://gitee.com/yhuse/SunnyUI</PackageProjectUrl>
<RepositoryUrl>https://gitee.com/yhuse/SunnyUI</RepositoryUrl> <RepositoryUrl>https://gitee.com/yhuse/SunnyUI</RepositoryUrl>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageIcon>SunnyUI.png</PackageIcon> <PackageIcon>SunnyUI.png</PackageIcon>
<SignAssembly>False</SignAssembly> <SignAssembly>False</SignAssembly>
<AssemblyOriginatorKeyFile>D:\MyDocuments\SunnyUI.pfx</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>D:\MyDocuments\SunnyUI.pfx</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign> <DelaySign>False</DelaySign>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild> <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\Bin\</OutputPath> <OutputPath>..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile></DocumentationFile> <DocumentationFile></DocumentationFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\Bin\</OutputPath> <OutputPath>..\Bin\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile></DocumentationFile> <DocumentationFile></DocumentationFile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net5.0-windows|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net5.0-windows|AnyCPU'">
<Optimize>false</Optimize> <Optimize>false</Optimize>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Include="..\LICENSE"> <None Include="..\LICENSE">
<Pack>True</Pack> <Pack>True</Pack>
<PackagePath></PackagePath> <PackagePath></PackagePath>
</None> </None>
<None Include="..\SunnyUI.png"> <None Include="..\SunnyUI.png">
<Pack>True</Pack> <Pack>True</Pack>
<PackagePath></PackagePath> <PackagePath></PackagePath>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Font\ElegantIcons.ttf" /> <EmbeddedResource Include="Font\ElegantIcons.ttf" />
<EmbeddedResource Include="Font\fa-brands-400.ttf" /> <EmbeddedResource Include="Font\fa-brands-400.ttf" />
<EmbeddedResource Include="Font\fa-regular-400.ttf" /> <EmbeddedResource Include="Font\fa-regular-400.ttf" />
<EmbeddedResource Include="Font\fa-solid-900.ttf" /> <EmbeddedResource Include="Font\fa-solid-900.ttf" />
<EmbeddedResource Include="Font\FontAwesome.ttf" /> <EmbeddedResource Include="Font\FontAwesome.ttf" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'"> <ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net472'"> <ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SunnyUI.Common" Version="3.1.2" /> <PackageReference Include="SunnyUI.Common" Version="3.1.*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Properties\Resources.Designer.cs"> <Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx"> <EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>