移除不必要的构造函数传参

This commit is contained in:
czz_y 2024-08-17 17:53:17 +08:00
parent 17e5d179d5
commit f93aca817a
5 changed files with 23 additions and 7 deletions

17
MainWindow.Designer.cs generated
View File

@ -33,10 +33,13 @@
this.divider = new AntdUI.Divider();
this.menu = new AntdUI.Menu();
this.panel_content = new AntdUI.StackPanel();
this.button1 = new AntdUI.Button();
this.titlebar.SuspendLayout();
this.SuspendLayout();
//
// titlebar
//
this.titlebar.Controls.Add(this.button1);
this.titlebar.Dock = System.Windows.Forms.DockStyle.Top;
this.titlebar.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.titlebar.Location = new System.Drawing.Point(6, 0);
@ -77,6 +80,18 @@
this.panel_content.TabIndex = 10;
this.panel_content.Vertical = true;
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.Right;
this.button1.Ghost = true;
this.button1.ImageSvg = resources.GetString("button1.ImageSvg");
this.button1.Location = new System.Drawing.Point(832, 0);
this.button1.Name = "button1";
this.button1.Radius = 0;
this.button1.Size = new System.Drawing.Size(50, 40);
this.button1.TabIndex = 0;
this.button1.WaveSize = 0;
//
// MainWindow
//
this.ClientSize = new System.Drawing.Size(1008, 624);
@ -92,6 +107,7 @@
this.Padding = new System.Windows.Forms.Padding(6, 0, 0, 6);
this.Resizable = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.titlebar.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -102,5 +118,6 @@
private AntdUI.Divider divider;
private AntdUI.Menu menu;
private AntdUI.StackPanel panel_content;
private AntdUI.Button button1;
}
}

View File

@ -68,7 +68,7 @@ namespace AntdUIDemo
control = new PanelDemo();
break;
case "StackPanel":
control = new StackPanelDemo(this);
control = new StackPanelDemo();
break;
}
if (control != null)

View File

@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="button1.ImageSvg" xml:space="preserve">
<value>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"&gt;&lt;path d="M24 4L18 10H10V18L4 24L10 30V38H18L24 44L30 38H38V30L44 24L38 18V10H30L24 4Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/&gt;&lt;path d="M24 30C27.3137 30 30 27.3137 30 24C30 20.6863 27.3137 18 24 18C20.6863 18 18 20.6863 18 24C18 27.3137 20.6863 30 24 30Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/&gt;&lt;/svg&gt;</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -220,7 +220,7 @@
//
this.button33.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button33.JoinLeft = true;
this.button33.Location = new System.Drawing.Point(152, 3);
this.button33.Location = new System.Drawing.Point(151, 3);
this.button33.Name = "button33";
this.button33.Size = new System.Drawing.Size(75, 32);
this.button33.TabIndex = 4;

View File

@ -13,10 +13,8 @@ namespace AntdUIDemo.Views
{
public partial class StackPanelDemo : UserControl
{
private Window form;
public StackPanelDemo(Window _form)
public StackPanelDemo()
{
form = _form;
InitializeComponent();
//设置默认值
InitData();
@ -45,7 +43,6 @@ namespace AntdUIDemo.Views
WaveSize = 0,
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
};
form.AutoDpi(control);
stackPanel.Controls.Add(control);
}
}
@ -76,7 +73,6 @@ namespace AntdUIDemo.Views
WaveSize = 0,
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
};
form.AutoDpi(control);
stackPanel.Controls.Add(control);
}