项目结构优化

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
+1
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);
+10 -1
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),
});
}
+1
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);
+11 -5
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);
}
}