项目结构优化

This commit is contained in:
czz_y 2024-08-16 17:31:30 +08:00
parent 47908f8c03
commit dbd58bc87b
11 changed files with 46 additions and 51 deletions

2
.gitignore vendored
View File

@ -19,4 +19,4 @@ bin-release/
# Projects
/.vs
/packages
/Properties/PublishProfiles/FolderProfile.pubxml
/Properties/PublishProfiles/

View File

@ -7,8 +7,27 @@
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>assets\icon.ico</ApplicationIcon>
<PlatformTarget>AnyCPU</PlatformTarget>
<Copyright>Copyright © 2024 czz_y</Copyright>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<Version>1.5.2.0</Version>
<Authors>czz_y</Authors>
<Description>基于 Winform UI框架 AntdUI 设计的Demo</Description>
<PackageProjectUrl>https://gitee.com/mubaiyanghua/antd-uidemo</PackageProjectUrl>
<PackageIcon>logo.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://gitee.com/mubaiyanghua/antd-uidemo</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>AntdUIDemo;Winform;WinformUI;AntDesign;控件演示</PackageTags>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
<Content Include="assets\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AntdUI" Version="1.5.2" />
</ItemGroup>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

View File

@ -10,6 +10,7 @@ namespace AntdUIDemo
public MainWindow()
{
InitializeComponent();
AntdUI.Config.ShowInWindow = true;
//加载菜单
LoadMenu();
menu.SelectChanged += Menu_SelectChanged;
@ -58,7 +59,7 @@ namespace AntdUIDemo
control = new FloatButtonDemo(this);
break;
case "FlowPanel":
control = new FlowPanelDemo();
control = new FlowPanelDemo(this);
break;
case "GridPanel":
control = new GridPanelDemo();

View File

@ -1,36 +0,0 @@
# AntdUIDemo
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -6,7 +6,7 @@
```
1. git clone 或者直接下载本项目
2. 使用 Visual Studio打开项目按照提示或自行安装 .NET Framework4.8
2. 若电脑缩放不是100%,使用 Visual Studio 在100%缩放模式下(命令行使用 devenv /noScale 命令启动 Visual Studio)打开项目,并按照提示或自行安装 .NET Framework4.8
3. 编译运行
```

View File

@ -502,6 +502,7 @@
//
// FloatButtonDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "FloatButtonDemo";
this.Size = new System.Drawing.Size(710, 372);

View File

@ -107,16 +107,25 @@ namespace AntdUIDemo.Views
}, btn =>
{
//回调事件
AntdUI.Message.info(form, btn.Tooltip, autoClose: 1);
})
// 浮动全局配置
{
// 配置
//字体
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point),
//附着控件
Control = null,
//位置
Align = (TAlign)select_align.SelectedIndex,
//是否垂直方向
Vertical = select_vertical.SelectedIndex == 0,
//是否置顶
TopMost = select_topmost.SelectedIndex == 0,
//尺寸大小
Size = Convert.ToInt32(input_size.Value),
//相对于Align位置X轴偏移
MarginX = Convert.ToInt32(input_mx.Value),
//相对于Align位置Y轴偏移
MarginY = Convert.ToInt32(input_my.Value),
});
}

View File

@ -445,6 +445,7 @@
//
// FlowPanelDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "FlowPanelDemo";
this.Size = new System.Drawing.Size(707, 496);

View File

@ -7,8 +7,10 @@ namespace AntdUIDemo.Views
{
public partial class FlowPanelDemo : UserControl
{
public FlowPanelDemo()
private AntdUI.Window form;
public FlowPanelDemo(Window _form)
{
form = _form;
InitializeComponent();
//初始化下拉框
InitSelectItems();
@ -46,7 +48,7 @@ namespace AntdUIDemo.Views
// 添加按钮
private void buttonADD_Click(object sender, EventArgs e)
{
flowPanel.Controls.Add(new AntdUI.Button()
var control = new AntdUI.Button()
{
Text = "Button",
Type = TTypeMini.Primary,
@ -54,7 +56,9 @@ namespace AntdUIDemo.Views
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
Size = new Size(90, 42),
});
};
form.AutoDpi(control);
flowPanel.Controls.Add(control);
}
// 删除按钮
@ -76,7 +80,7 @@ namespace AntdUIDemo.Views
flowPanel.Controls.Clear();
for (int i = 0; i < 14; i++)
{
flowPanel.Controls.Add(new AntdUI.Button()
var control = new AntdUI.Button()
{
Text = "Button",
Type = TTypeMini.Primary,
@ -84,7 +88,9 @@ namespace AntdUIDemo.Views
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
Size = new Size(90, 42),
});
};
form.AutoDpi(control);
flowPanel.Controls.Add(control);
}
}

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB