From f93aca817adc9e3625fff5387806f535876c1234 Mon Sep 17 00:00:00 2001 From: czz_y Date: Sat, 17 Aug 2024 17:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainWindow.Designer.cs | 17 +++++++++++++++++ MainWindow.cs | 2 +- MainWindow.resx | 3 +++ Views/ButtonDemo.Designer.cs | 2 +- Views/StackPanelDemo.cs | 6 +----- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/MainWindow.Designer.cs b/MainWindow.Designer.cs index a6d2e04..520a564 100644 --- a/MainWindow.Designer.cs +++ b/MainWindow.Designer.cs @@ -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; } } \ No newline at end of file diff --git a/MainWindow.cs b/MainWindow.cs index 2441188..a20bcc9 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -68,7 +68,7 @@ namespace AntdUIDemo control = new PanelDemo(); break; case "StackPanel": - control = new StackPanelDemo(this); + control = new StackPanelDemo(); break; } if (control != null) diff --git a/MainWindow.resx b/MainWindow.resx index 4caa338..f7dc91b 100644 --- a/MainWindow.resx +++ b/MainWindow.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 4L18 10H10V18L4 24L10 30V38H18L24 44L30 38H38V30L44 24L38 18V10H30L24 4Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><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"/></svg> + diff --git a/Views/ButtonDemo.Designer.cs b/Views/ButtonDemo.Designer.cs index e52f73a..9211926 100644 --- a/Views/ButtonDemo.Designer.cs +++ b/Views/ButtonDemo.Designer.cs @@ -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; diff --git a/Views/StackPanelDemo.cs b/Views/StackPanelDemo.cs index 9d00d8e..30553bc 100644 --- a/Views/StackPanelDemo.cs +++ b/Views/StackPanelDemo.cs @@ -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); }