From 9348312b55301a3b4af5cd9b63a1c87413e53aa8 Mon Sep 17 00:00:00 2001 From: czz_y Date: Wed, 21 Aug 2024 15:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0DropDown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controls/SystemSet.cs | 80 ++-- MainWindow.cs | 3 + Models/DataUtil.cs | 2 +- README.md | 2 +- Views/ButtonDemo.Designer.cs | 40 +- Views/ButtonDemo.resx | 22 +- Views/DropDownDemo.Designer.cs | 699 ++++++++++++++++++++++++++++++ Views/DropDownDemo.cs | 97 +++++ Views/DropDownDemo.resx | 120 +++++ Views/FloatButtonDemo.Designer.cs | 86 ++-- Views/FloatButtonDemo.cs | 40 +- Views/FlowPanelDemo.cs | 22 +- Views/GridPanelDemo.cs | 23 +- Views/PanelDemo.Designer.cs | 2 +- Views/PanelDemo.cs | 14 +- 15 files changed, 1085 insertions(+), 167 deletions(-) create mode 100644 Views/DropDownDemo.Designer.cs create mode 100644 Views/DropDownDemo.cs create mode 100644 Views/DropDownDemo.resx diff --git a/Controls/SystemSet.cs b/Controls/SystemSet.cs index a7c47c0..cce6e25 100644 --- a/Controls/SystemSet.cs +++ b/Controls/SystemSet.cs @@ -37,52 +37,20 @@ namespace AntdUIDemo.Controls } - private void Input_offset_ValueChanged(object sender, decimal value) - { - AppSetting.UpdateAppSetting("ShowOffset", input_offset.Value.ToString()); - AntdUI.Config.NoticeWindowOffsetXY = (int)value; - } - - private void switch_showinwindow_CheckedChanged(object sender, bool value) - { - AppSetting.UpdateAppSetting("ShowInWindow", value ? "True" : "False"); - AntdUI.Config.ShowInWindow = value; - AntdUI.Message.success(Window,"切换成功!",autoClose: 1); - AntdUI.Notification.success(Window, "提示","切换成功!", autoClose: 3); - } - - private void switch_scrollbar_CheckedChanged(object sender, bool value) - { - AppSetting.UpdateAppSetting("ScrollBarHide", value ? "True" : "False"); - AntdUI.Config.ScrollBarHide = value; - } - - private void switch_shadow_CheckedChanged(object sender, bool value) - { - AppSetting.UpdateAppSetting("ShadowEnabled", value ? "True" : "False"); - AntdUI.Config.ShadowEnabled = value; - } - private void InitData() { tabs.SelectedIndex = 0; //色彩模式 var colormode = ConfigurationManager.AppSettings["ColorMode"]; - switch (colormode) - { - case "Dark": - select_colormode.SelectedIndex = 2; - break; - case "Light": - select_colormode.SelectedIndex = 1; - break; - case "Auto": - select_colormode.SelectedIndex = 0; - break; - default: - select_colormode.SelectedIndex = 0; - break; - } + var modeIndexMapping = new Dictionary + { + { "Dark", 2 }, + { "Light", 1 }, + { "Auto", 0 } + }; + select_colormode.SelectedIndex = modeIndexMapping.ContainsKey(colormode) + ? modeIndexMapping[colormode] + : 0; //开启动画 var animation = ConfigurationManager.AppSettings["Animation"]; switch_animation.Checked = animation == "True"; @@ -100,6 +68,7 @@ namespace AntdUIDemo.Controls input_offset.Value = decimal.Parse(offset); } + #region 事件 private void Select_colormode_SelectedIndexChanged(object sender, int value) { AppSetting.UpdateAppSetting("ColorMode", select_colormode.SelectedValue.ToString()); @@ -118,5 +87,34 @@ namespace AntdUIDemo.Controls AppSetting.UpdateAppSetting("Animation", switch_animation.Checked.ToString()); AntdUI.Config.Animation = value; } + + private void Input_offset_ValueChanged(object sender, decimal value) + { + AppSetting.UpdateAppSetting("ShowOffset", input_offset.Value.ToString()); + AntdUI.Config.NoticeWindowOffsetXY = (int)value; + } + + private void switch_showinwindow_CheckedChanged(object sender, bool value) + { + AppSetting.UpdateAppSetting("ShowInWindow", value ? "True" : "False"); + AntdUI.Config.ShowInWindow = value; + AntdUI.Message.success(Window, "切换成功!", autoClose: 1); + AntdUI.Notification.success(Window, "提示", "切换成功!", autoClose: 1); + } + + private void switch_scrollbar_CheckedChanged(object sender, bool value) + { + AppSetting.UpdateAppSetting("ScrollBarHide", value ? "True" : "False"); + AntdUI.Config.ScrollBarHide = value; + } + + private void switch_shadow_CheckedChanged(object sender, bool value) + { + AppSetting.UpdateAppSetting("ShadowEnabled", value ? "True" : "False"); + AntdUI.Config.ShadowEnabled = value; + } + #endregion + + } } diff --git a/MainWindow.cs b/MainWindow.cs index 7118b05..d47403d 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -158,6 +158,9 @@ namespace AntdUIDemo case "StackPanel": control = new StackPanelDemo(); break; + case "Dropdown": + control = new DropDownDemo(); + break; } if (control != null) { diff --git a/Models/DataUtil.cs b/Models/DataUtil.cs index d3aa9ee..1f8657a 100644 --- a/Models/DataUtil.cs +++ b/Models/DataUtil.cs @@ -26,7 +26,7 @@ namespace AntdUIDemo.Models }, { "导航", new List { - new MenuItems { Text = "DropDown 下拉菜单", Tag = "DropDown"}, + new MenuItems { Text = "Dropdown 下拉菜单", Tag = "Dropdown"}, new MenuItems { Text = "Menu 导航菜单", Tag = "Menu"}, new MenuItems { Text = "Pagination 分页", Tag = "Pagination"}, new MenuItems { Text = "Steps 步骤条", Tag = "Steps"} diff --git a/README.md b/README.md index 767c86c..6ff0885 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ ![StackPanel](assets/screenshots/StackPanel.png) ### 导航 -#### DropDown 下拉菜单 +#### Dropdown 下拉菜单 #### Menu 导航菜单 #### Pagination 分页 #### Steps 步骤条 diff --git a/Views/ButtonDemo.Designer.cs b/Views/ButtonDemo.Designer.cs index 8cd47a5..cec7d51 100644 --- a/Views/ButtonDemo.Designer.cs +++ b/Views/ButtonDemo.Designer.cs @@ -136,7 +136,7 @@ // this.button39.BackExtend = "135, #6253E1, #04BEFE"; this.button39.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button39.ImageSvg = resources.GetString("button39.ImageSvg"); + this.button39.IconSvg = resources.GetString("button39.IconSvg"); this.button39.Location = new System.Drawing.Point(3, 3); this.button39.Name = "button39"; this.button39.Size = new System.Drawing.Size(156, 32); @@ -194,7 +194,7 @@ this.button37.BorderWidth = 2F; this.button37.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button37.Ghost = true; - this.button37.ImageSvg = resources.GetString("button37.ImageSvg"); + this.button37.IconSvg = resources.GetString("button37.IconSvg"); this.button37.JoinRight = true; this.button37.Location = new System.Drawing.Point(3, 3); this.button37.Name = "button37"; @@ -231,7 +231,7 @@ // button34 // this.button34.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button34.ImageSvg = resources.GetString("button34.ImageSvg"); + this.button34.IconSvg = resources.GetString("button34.IconSvg"); this.button34.JoinLeft = true; this.button34.JoinRight = true; this.button34.Location = new System.Drawing.Point(77, 3); @@ -280,11 +280,11 @@ this.button28.BorderWidth = 2F; this.button28.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button28.Ghost = true; - this.button28.ImageSvg = resources.GetString("button28.ImageSvg"); - this.button28.Location = new System.Drawing.Point(327, 3); + this.button28.IconSvg = resources.GetString("button28.IconSvg"); + this.button28.Location = new System.Drawing.Point(347, 3); this.button28.Name = "button28"; this.button28.ShowArrow = true; - this.button28.Size = new System.Drawing.Size(75, 32); + this.button28.Size = new System.Drawing.Size(80, 32); this.button28.TabIndex = 11; this.button28.Text = "搜索"; this.button28.Type = AntdUI.TTypeMini.Primary; @@ -294,11 +294,11 @@ // this.button27.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button27.Ghost = true; - this.button27.ImageSvg = resources.GetString("button27.ImageSvg"); - this.button27.Location = new System.Drawing.Point(246, 3); + this.button27.IconSvg = resources.GetString("button27.IconSvg"); + this.button27.Location = new System.Drawing.Point(261, 3); this.button27.Name = "button27"; this.button27.ShowArrow = true; - this.button27.Size = new System.Drawing.Size(75, 32); + this.button27.Size = new System.Drawing.Size(80, 32); this.button27.TabIndex = 10; this.button27.Text = "搜索"; this.button27.Type = AntdUI.TTypeMini.Primary; @@ -309,10 +309,10 @@ this.button26.BorderWidth = 2F; this.button26.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button26.Ghost = true; - this.button26.Location = new System.Drawing.Point(165, 3); + this.button26.Location = new System.Drawing.Point(175, 3); this.button26.Name = "button26"; this.button26.ShowArrow = true; - this.button26.Size = new System.Drawing.Size(75, 32); + this.button26.Size = new System.Drawing.Size(80, 32); this.button26.TabIndex = 9; this.button26.Text = "Primary"; this.button26.Type = AntdUI.TTypeMini.Primary; @@ -322,10 +322,10 @@ // this.button25.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button25.Ghost = true; - this.button25.Location = new System.Drawing.Point(84, 3); + this.button25.Location = new System.Drawing.Point(89, 3); this.button25.Name = "button25"; this.button25.ShowArrow = true; - this.button25.Size = new System.Drawing.Size(75, 32); + this.button25.Size = new System.Drawing.Size(80, 32); this.button25.TabIndex = 8; this.button25.Text = "Primary"; this.button25.Type = AntdUI.TTypeMini.Primary; @@ -337,7 +337,7 @@ this.button29.Location = new System.Drawing.Point(3, 3); this.button29.Name = "button29"; this.button29.ShowArrow = true; - this.button29.Size = new System.Drawing.Size(75, 32); + this.button29.Size = new System.Drawing.Size(80, 32); this.button29.TabIndex = 7; this.button29.Text = "Primary"; this.button29.Type = AntdUI.TTypeMini.Primary; @@ -371,7 +371,7 @@ this.button21.BorderWidth = 2F; this.button21.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button21.Ghost = true; - this.button21.ImageSvg = resources.GetString("button21.ImageSvg"); + this.button21.IconSvg = resources.GetString("button21.IconSvg"); this.button21.Location = new System.Drawing.Point(279, 3); this.button21.Name = "button21"; this.button21.Size = new System.Drawing.Size(75, 32); @@ -385,7 +385,7 @@ this.button22.BorderWidth = 2F; this.button22.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button22.Ghost = true; - this.button22.ImageSvg = resources.GetString("button22.ImageSvg"); + this.button22.IconSvg = resources.GetString("button22.IconSvg"); this.button22.Location = new System.Drawing.Point(241, 3); this.button22.Name = "button22"; this.button22.Shape = AntdUI.TShape.Circle; @@ -398,7 +398,7 @@ // this.button19.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button19.Ghost = true; - this.button19.ImageSvg = resources.GetString("button19.ImageSvg"); + this.button19.IconSvg = resources.GetString("button19.IconSvg"); this.button19.Location = new System.Drawing.Point(160, 3); this.button19.Name = "button19"; this.button19.RightToLeft = System.Windows.Forms.RightToLeft.No; @@ -412,7 +412,7 @@ // this.button20.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button20.Ghost = true; - this.button20.ImageSvg = resources.GetString("button20.ImageSvg"); + this.button20.IconSvg = resources.GetString("button20.IconSvg"); this.button20.Location = new System.Drawing.Point(122, 3); this.button20.Name = "button20"; this.button20.Shape = AntdUI.TShape.Circle; @@ -424,7 +424,7 @@ // button23 // this.button23.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button23.ImageSvg = resources.GetString("button23.ImageSvg"); + this.button23.IconSvg = resources.GetString("button23.IconSvg"); this.button23.Location = new System.Drawing.Point(41, 3); this.button23.Name = "button23"; this.button23.Size = new System.Drawing.Size(75, 32); @@ -435,7 +435,7 @@ // button24 // this.button24.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button24.ImageSvg = resources.GetString("button24.ImageSvg"); + this.button24.IconSvg = resources.GetString("button24.IconSvg"); this.button24.Location = new System.Drawing.Point(3, 3); this.button24.Name = "button24"; this.button24.Shape = AntdUI.TShape.Circle; diff --git a/Views/ButtonDemo.resx b/Views/ButtonDemo.resx index b433e67..44792e5 100644 --- a/Views/ButtonDemo.resx +++ b/Views/ButtonDemo.resx @@ -117,37 +117,37 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + <svg viewBox="64 64 896 896"><path d="M716.3 313.8c19-18.9 19-49.7 0-68.6l-69.9-69.9.1.1c-18.5-18.5-50.3-50.3-95.3-95.2-21.2-20.7-55.5-20.5-76.5.5L80.9 474.2a53.84 53.84 0 000 76.4L474.6 944a54.14 54.14 0 0076.5 0l165.1-165c19-18.9 19-49.7 0-68.6a48.7 48.7 0 00-68.7 0l-125 125.2c-5.2 5.2-13.3 5.2-18.5 0L189.5 521.4c-5.2-5.2-5.2-13.3 0-18.5l314.4-314.2c.4-.4.9-.7 1.3-1.1 5.2-4.1 12.4-3.7 17.2 1.1l125.2 125.1c19 19 49.8 19 68.7 0zM408.6 514.4a106.3 106.2 0 10212.6 0 106.3 106.2 0 10-212.6 0zm536.2-38.6L821.9 353.5c-19-18.9-49.8-18.9-68.7.1a48.4 48.4 0 000 68.6l83 82.9c5.2 5.2 5.2 13.3 0 18.5l-81.8 81.7a48.4 48.4 0 000 68.6 48.7 48.7 0 0068.7 0l121.8-121.7a53.93 53.93 0 00-.1-76.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="poweroff" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="poweroff" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="poweroff" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg> - + <svg viewBox="64 64 896 896" focusable="false" data-icon="poweroff" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M705.6 124.9a8 8 0 00-11.6 7.2v64.2c0 5.5 2.9 10.6 7.5 13.6a352.2 352.2 0 0162.2 49.8c32.7 32.8 58.4 70.9 76.3 113.3a355 355 0 0127.9 138.7c0 48.1-9.4 94.8-27.9 138.7a355.92 355.92 0 01-76.3 113.3 353.06 353.06 0 01-113.2 76.4c-43.8 18.6-90.5 28-138.5 28s-94.7-9.4-138.5-28a353.06 353.06 0 01-113.2-76.4A355.92 355.92 0 01184 650.4a355 355 0 01-27.9-138.7c0-48.1 9.4-94.8 27.9-138.7 17.9-42.4 43.6-80.5 76.3-113.3 19-19 39.8-35.6 62.2-49.8 4.7-2.9 7.5-8.1 7.5-13.6V132c0-6-6.3-9.8-11.6-7.2C178.5 195.2 82 339.3 80 506.3 77.2 745.1 272.5 943.5 511.2 944c239 .5 432.8-193.3 432.8-432.4 0-169.2-97-315.7-238.4-386.7zM480 560h64c4.4 0 8-3.6 8-8V88c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8z"></path></svg> \ No newline at end of file diff --git a/Views/DropDownDemo.Designer.cs b/Views/DropDownDemo.Designer.cs new file mode 100644 index 0000000..9b4b9c6 --- /dev/null +++ b/Views/DropDownDemo.Designer.cs @@ -0,0 +1,699 @@ +namespace AntdUIDemo.Views +{ + partial class DropDownDemo + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.label1 = new AntdUI.Label(); + this.label2 = new AntdUI.Label(); + this.label3 = new AntdUI.Label(); + this.label4 = new AntdUI.Label(); + this.label5 = new AntdUI.Label(); + this.stackPanel1 = new AntdUI.StackPanel(); + this.flowPanel6 = new AntdUI.FlowPanel(); + this.dropdown33 = new AntdUI.Dropdown(); + this.dropdown32 = new AntdUI.Dropdown(); + this.dropdown31 = new AntdUI.Dropdown(); + this.dropdown30 = new AntdUI.Dropdown(); + this.dropdown28 = new AntdUI.Dropdown(); + this.dropdown34 = new AntdUI.Dropdown(); + this.label8 = new AntdUI.Label(); + this.flowPanel5 = new AntdUI.FlowPanel(); + this.dropdown26 = new AntdUI.Dropdown(); + this.dropdown25 = new AntdUI.Dropdown(); + this.label7 = new AntdUI.Label(); + this.divider1 = new AntdUI.Divider(); + this.label6 = new AntdUI.Label(); + this.flowPanel1 = new AntdUI.FlowPanel(); + this.dropdown1 = new AntdUI.Dropdown(); + this.dropdown2 = new AntdUI.Dropdown(); + this.dropdown3 = new AntdUI.Dropdown(); + this.label9 = new AntdUI.Label(); + this.flowPanel2 = new AntdUI.FlowPanel(); + this.dropdown4 = new AntdUI.Dropdown(); + this.dropdown5 = new AntdUI.Dropdown(); + this.dropdown6 = new AntdUI.Dropdown(); + this.label10 = new AntdUI.Label(); + this.flowPanel3 = new AntdUI.FlowPanel(); + this.dropdown_multi = new AntdUI.Dropdown(); + this.label11 = new AntdUI.Label(); + this.flowPanel4 = new AntdUI.FlowPanel(); + this.dropdown_icon = new AntdUI.Dropdown(); + this.label12 = new AntdUI.Label(); + this.flowPanel7 = new AntdUI.FlowPanel(); + this.dropdown_online = new AntdUI.Dropdown(); + this.dropdown_enable = new AntdUI.Dropdown(); + this.dropdown_custom = new AntdUI.Dropdown(); + this.stackPanel1.SuspendLayout(); + this.flowPanel6.SuspendLayout(); + this.flowPanel5.SuspendLayout(); + this.flowPanel1.SuspendLayout(); + this.flowPanel2.SuspendLayout(); + this.flowPanel3.SuspendLayout(); + this.flowPanel4.SuspendLayout(); + this.flowPanel7.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(694, 40); + this.label1.TabIndex = 1; + this.label1.Text = "Dropdown 下拉菜单"; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(3, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(694, 24); + this.label2.TabIndex = 2; + this.label2.Text = "向下弹出的列表。"; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label3.Location = new System.Drawing.Point(3, 79); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(694, 39); + this.label3.TabIndex = 18; + this.label3.Text = "当页面上的操作命令过多时,用此组件可以收纳操作元素。点击或移入触点,会出现一个下拉菜单。可在列表中进行选择,并执行相应的命令。"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label4.Location = new System.Drawing.Point(3, 124); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(694, 24); + this.label4.TabIndex = 24; + this.label4.Text = "○ 用于收罗一组命令操作"; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label5.Location = new System.Drawing.Point(3, 154); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(694, 24); + this.label5.TabIndex = 30; + this.label5.Text = "○ Select 用于选择,而 Dropdown 是命令集合"; + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.flowPanel7); + this.stackPanel1.Controls.Add(this.label12); + this.stackPanel1.Controls.Add(this.flowPanel4); + this.stackPanel1.Controls.Add(this.label11); + this.stackPanel1.Controls.Add(this.flowPanel3); + this.stackPanel1.Controls.Add(this.label10); + this.stackPanel1.Controls.Add(this.flowPanel2); + this.stackPanel1.Controls.Add(this.label9); + this.stackPanel1.Controls.Add(this.flowPanel1); + this.stackPanel1.Controls.Add(this.label6); + this.stackPanel1.Controls.Add(this.flowPanel6); + this.stackPanel1.Controls.Add(this.label8); + this.stackPanel1.Controls.Add(this.flowPanel5); + this.stackPanel1.Controls.Add(this.label7); + this.stackPanel1.Controls.Add(this.divider1); + this.stackPanel1.Controls.Add(this.label5); + this.stackPanel1.Controls.Add(this.label4); + this.stackPanel1.Controls.Add(this.label3); + this.stackPanel1.Controls.Add(this.label2); + this.stackPanel1.Controls.Add(this.label1); + this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stackPanel1.Location = new System.Drawing.Point(0, 0); + this.stackPanel1.Name = "stackPanel1"; + this.stackPanel1.Size = new System.Drawing.Size(700, 806); + this.stackPanel1.TabIndex = 0; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // flowPanel6 + // + this.flowPanel6.Controls.Add(this.dropdown33); + this.flowPanel6.Controls.Add(this.dropdown32); + this.flowPanel6.Controls.Add(this.dropdown31); + this.flowPanel6.Controls.Add(this.dropdown30); + this.flowPanel6.Controls.Add(this.dropdown28); + this.flowPanel6.Controls.Add(this.dropdown34); + this.flowPanel6.Location = new System.Drawing.Point(3, 306); + this.flowPanel6.Name = "flowPanel6"; + this.flowPanel6.Size = new System.Drawing.Size(694, 38); + this.flowPanel6.TabIndex = 35; + this.flowPanel6.Text = "flowPanel6"; + // + // dropdown33 + // + this.dropdown33.BorderWidth = 2F; + this.dropdown33.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown33.Ghost = true; + this.dropdown33.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown33.Location = new System.Drawing.Point(458, 3); + this.dropdown33.Name = "dropdown33"; + this.dropdown33.Placement = AntdUI.TAlignFrom.TR; + this.dropdown33.Size = new System.Drawing.Size(85, 32); + this.dropdown33.TabIndex = 7; + this.dropdown33.Text = "TopRight"; + this.dropdown33.Trigger = AntdUI.Trigger.Hover; + this.dropdown33.Type = AntdUI.TTypeMini.Primary; + this.dropdown33.WaveSize = 0; + // + // dropdown32 + // + this.dropdown32.BorderWidth = 2F; + this.dropdown32.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown32.Ghost = true; + this.dropdown32.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown32.Location = new System.Drawing.Point(367, 3); + this.dropdown32.Name = "dropdown32"; + this.dropdown32.Placement = AntdUI.TAlignFrom.Top; + this.dropdown32.Size = new System.Drawing.Size(85, 32); + this.dropdown32.TabIndex = 6; + this.dropdown32.Text = "Top"; + this.dropdown32.Trigger = AntdUI.Trigger.Hover; + this.dropdown32.Type = AntdUI.TTypeMini.Primary; + this.dropdown32.WaveSize = 0; + // + // dropdown31 + // + this.dropdown31.BorderWidth = 2F; + this.dropdown31.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown31.Ghost = true; + this.dropdown31.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown31.Location = new System.Drawing.Point(276, 3); + this.dropdown31.Name = "dropdown31"; + this.dropdown31.Placement = AntdUI.TAlignFrom.TL; + this.dropdown31.Size = new System.Drawing.Size(85, 32); + this.dropdown31.TabIndex = 5; + this.dropdown31.Text = "TopLeft"; + this.dropdown31.Trigger = AntdUI.Trigger.Hover; + this.dropdown31.Type = AntdUI.TTypeMini.Primary; + this.dropdown31.WaveSize = 0; + // + // dropdown30 + // + this.dropdown30.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown30.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown30.Location = new System.Drawing.Point(185, 3); + this.dropdown30.Name = "dropdown30"; + this.dropdown30.Placement = AntdUI.TAlignFrom.BR; + this.dropdown30.Size = new System.Drawing.Size(85, 32); + this.dropdown30.TabIndex = 4; + this.dropdown30.Text = "BottomRight"; + this.dropdown30.Trigger = AntdUI.Trigger.Hover; + this.dropdown30.Type = AntdUI.TTypeMini.Primary; + this.dropdown30.WaveSize = 0; + // + // dropdown28 + // + this.dropdown28.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown28.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown28.Location = new System.Drawing.Point(94, 3); + this.dropdown28.Name = "dropdown28"; + this.dropdown28.Placement = AntdUI.TAlignFrom.Bottom; + this.dropdown28.Size = new System.Drawing.Size(85, 32); + this.dropdown28.TabIndex = 3; + this.dropdown28.Text = "Bottom"; + this.dropdown28.Trigger = AntdUI.Trigger.Hover; + this.dropdown28.Type = AntdUI.TTypeMini.Primary; + this.dropdown28.WaveSize = 0; + // + // dropdown34 + // + this.dropdown34.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown34.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown34.Location = new System.Drawing.Point(3, 3); + this.dropdown34.Name = "dropdown34"; + this.dropdown34.Size = new System.Drawing.Size(85, 32); + this.dropdown34.TabIndex = 2; + this.dropdown34.Text = "BottomLeft"; + this.dropdown34.Trigger = AntdUI.Trigger.Hover; + this.dropdown34.Type = AntdUI.TTypeMini.Primary; + this.dropdown34.WaveSize = 0; + // + // label8 + // + this.label8.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label8.Location = new System.Drawing.Point(3, 276); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(694, 24); + this.label8.TabIndex = 34; + this.label8.Text = "弹出位置"; + // + // flowPanel5 + // + this.flowPanel5.Controls.Add(this.dropdown26); + this.flowPanel5.Controls.Add(this.dropdown25); + this.flowPanel5.Location = new System.Drawing.Point(3, 232); + this.flowPanel5.Name = "flowPanel5"; + this.flowPanel5.Size = new System.Drawing.Size(694, 38); + this.flowPanel5.TabIndex = 33; + this.flowPanel5.Text = "flowPanel5"; + // + // dropdown26 + // + this.dropdown26.BorderWidth = 2F; + this.dropdown26.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown26.Ghost = true; + this.dropdown26.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown26.Location = new System.Drawing.Point(94, 3); + this.dropdown26.Name = "dropdown26"; + this.dropdown26.Size = new System.Drawing.Size(85, 32); + this.dropdown26.TabIndex = 3; + this.dropdown26.Text = "Hover"; + this.dropdown26.Trigger = AntdUI.Trigger.Hover; + this.dropdown26.Type = AntdUI.TTypeMini.Primary; + this.dropdown26.WaveSize = 0; + // + // dropdown25 + // + this.dropdown25.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown25.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown25.Location = new System.Drawing.Point(3, 3); + this.dropdown25.Name = "dropdown25"; + this.dropdown25.Size = new System.Drawing.Size(85, 32); + this.dropdown25.TabIndex = 2; + this.dropdown25.Text = "Click"; + this.dropdown25.Type = AntdUI.TTypeMini.Primary; + this.dropdown25.WaveSize = 0; + // + // label7 + // + this.label7.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label7.Location = new System.Drawing.Point(3, 202); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(694, 24); + this.label7.TabIndex = 32; + this.label7.Text = "触发类型"; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 184); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 31; + // + // label6 + // + this.label6.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(3, 350); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(694, 24); + this.label6.TabIndex = 36; + this.label6.Text = "显示箭头"; + // + // flowPanel1 + // + this.flowPanel1.Controls.Add(this.dropdown3); + this.flowPanel1.Controls.Add(this.dropdown1); + this.flowPanel1.Controls.Add(this.dropdown2); + this.flowPanel1.Location = new System.Drawing.Point(3, 380); + this.flowPanel1.Name = "flowPanel1"; + this.flowPanel1.Size = new System.Drawing.Size(694, 38); + this.flowPanel1.TabIndex = 37; + this.flowPanel1.Text = "flowPanel1"; + // + // dropdown1 + // + this.dropdown1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown1.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown1.Location = new System.Drawing.Point(94, 3); + this.dropdown1.Name = "dropdown1"; + this.dropdown1.ShowArrow = true; + this.dropdown1.Size = new System.Drawing.Size(85, 32); + this.dropdown1.TabIndex = 3; + this.dropdown1.Text = "Arrow"; + this.dropdown1.Trigger = AntdUI.Trigger.Hover; + this.dropdown1.Type = AntdUI.TTypeMini.Primary; + this.dropdown1.WaveSize = 0; + // + // dropdown2 + // + this.dropdown2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown2.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown2.Location = new System.Drawing.Point(3, 3); + this.dropdown2.Name = "dropdown2"; + this.dropdown2.Size = new System.Drawing.Size(85, 32); + this.dropdown2.TabIndex = 2; + this.dropdown2.Text = "无"; + this.dropdown2.Trigger = AntdUI.Trigger.Hover; + this.dropdown2.Type = AntdUI.TTypeMini.Primary; + this.dropdown2.WaveSize = 0; + // + // dropdown3 + // + this.dropdown3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown3.IsLink = true; + this.dropdown3.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown3.Location = new System.Drawing.Point(185, 3); + this.dropdown3.Name = "dropdown3"; + this.dropdown3.ShowArrow = true; + this.dropdown3.Size = new System.Drawing.Size(85, 32); + this.dropdown3.TabIndex = 4; + this.dropdown3.Text = "link Arrow"; + this.dropdown3.Trigger = AntdUI.Trigger.Hover; + this.dropdown3.Type = AntdUI.TTypeMini.Primary; + this.dropdown3.WaveSize = 0; + // + // label9 + // + this.label9.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label9.Location = new System.Drawing.Point(3, 424); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(694, 24); + this.label9.TabIndex = 38; + this.label9.Text = "显示数量"; + // + // flowPanel2 + // + this.flowPanel2.Controls.Add(this.dropdown4); + this.flowPanel2.Controls.Add(this.dropdown5); + this.flowPanel2.Controls.Add(this.dropdown6); + this.flowPanel2.Location = new System.Drawing.Point(3, 454); + this.flowPanel2.Name = "flowPanel2"; + this.flowPanel2.Size = new System.Drawing.Size(694, 38); + this.flowPanel2.TabIndex = 39; + this.flowPanel2.Text = "flowPanel2"; + // + // dropdown4 + // + this.dropdown4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown4.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown4.Location = new System.Drawing.Point(185, 3); + this.dropdown4.MaxCount = 5; + this.dropdown4.Name = "dropdown4"; + this.dropdown4.ShowArrow = true; + this.dropdown4.Size = new System.Drawing.Size(85, 32); + this.dropdown4.TabIndex = 4; + this.dropdown4.Text = "5"; + this.dropdown4.Trigger = AntdUI.Trigger.Hover; + this.dropdown4.Type = AntdUI.TTypeMini.Primary; + this.dropdown4.WaveSize = 0; + // + // dropdown5 + // + this.dropdown5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown5.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown5.Location = new System.Drawing.Point(94, 3); + this.dropdown5.Name = "dropdown5"; + this.dropdown5.ShowArrow = true; + this.dropdown5.Size = new System.Drawing.Size(85, 32); + this.dropdown5.TabIndex = 3; + this.dropdown5.Text = "4"; + this.dropdown5.Trigger = AntdUI.Trigger.Hover; + this.dropdown5.Type = AntdUI.TTypeMini.Primary; + this.dropdown5.WaveSize = 0; + // + // dropdown6 + // + this.dropdown6.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown6.Items.AddRange(new object[] { + "first menu item", + "second menu item", + "third menu item", + "fourth menu item", + "fifth menu item"}); + this.dropdown6.Location = new System.Drawing.Point(3, 3); + this.dropdown6.MaxCount = 3; + this.dropdown6.Name = "dropdown6"; + this.dropdown6.ShowArrow = true; + this.dropdown6.Size = new System.Drawing.Size(85, 32); + this.dropdown6.TabIndex = 2; + this.dropdown6.Text = "3"; + this.dropdown6.Trigger = AntdUI.Trigger.Hover; + this.dropdown6.Type = AntdUI.TTypeMini.Primary; + this.dropdown6.WaveSize = 0; + // + // label10 + // + this.label10.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label10.Location = new System.Drawing.Point(3, 498); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(694, 24); + this.label10.TabIndex = 40; + this.label10.Text = "多级菜单"; + // + // flowPanel3 + // + this.flowPanel3.Controls.Add(this.dropdown_multi); + this.flowPanel3.Location = new System.Drawing.Point(3, 528); + this.flowPanel3.Name = "flowPanel3"; + this.flowPanel3.Size = new System.Drawing.Size(694, 38); + this.flowPanel3.TabIndex = 41; + this.flowPanel3.Text = "flowPanel3"; + // + // dropdown_multi + // + this.dropdown_multi.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown_multi.Location = new System.Drawing.Point(3, 3); + this.dropdown_multi.Name = "dropdown_multi"; + this.dropdown_multi.ShowArrow = true; + this.dropdown_multi.Size = new System.Drawing.Size(85, 32); + this.dropdown_multi.TabIndex = 2; + this.dropdown_multi.Text = "Items"; + this.dropdown_multi.Trigger = AntdUI.Trigger.Hover; + this.dropdown_multi.Type = AntdUI.TTypeMini.Primary; + this.dropdown_multi.WaveSize = 0; + // + // label11 + // + this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label11.Location = new System.Drawing.Point(3, 572); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(694, 24); + this.label11.TabIndex = 42; + this.label11.Text = "图标菜单"; + // + // flowPanel4 + // + this.flowPanel4.Controls.Add(this.dropdown_icon); + this.flowPanel4.Location = new System.Drawing.Point(3, 602); + this.flowPanel4.Name = "flowPanel4"; + this.flowPanel4.Size = new System.Drawing.Size(694, 38); + this.flowPanel4.TabIndex = 43; + this.flowPanel4.Text = "flowPanel4"; + // + // dropdown_icon + // + this.dropdown_icon.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown_icon.Location = new System.Drawing.Point(3, 3); + this.dropdown_icon.Name = "dropdown_icon"; + this.dropdown_icon.ShowArrow = true; + this.dropdown_icon.Size = new System.Drawing.Size(85, 32); + this.dropdown_icon.TabIndex = 2; + this.dropdown_icon.Text = "Icon"; + this.dropdown_icon.Trigger = AntdUI.Trigger.Hover; + this.dropdown_icon.Type = AntdUI.TTypeMini.Primary; + this.dropdown_icon.WaveSize = 0; + // + // label12 + // + this.label12.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(3, 646); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(694, 24); + this.label12.TabIndex = 44; + this.label12.Text = "菜单状态"; + // + // flowPanel7 + // + this.flowPanel7.Controls.Add(this.dropdown_custom); + this.flowPanel7.Controls.Add(this.dropdown_enable); + this.flowPanel7.Controls.Add(this.dropdown_online); + this.flowPanel7.Location = new System.Drawing.Point(3, 676); + this.flowPanel7.Name = "flowPanel7"; + this.flowPanel7.Size = new System.Drawing.Size(694, 38); + this.flowPanel7.TabIndex = 45; + this.flowPanel7.Text = "flowPanel7"; + // + // dropdown_online + // + this.dropdown_online.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown_online.Location = new System.Drawing.Point(3, 3); + this.dropdown_online.Name = "dropdown_online"; + this.dropdown_online.ShowArrow = true; + this.dropdown_online.Size = new System.Drawing.Size(85, 32); + this.dropdown_online.TabIndex = 2; + this.dropdown_online.Text = "在线状态"; + this.dropdown_online.Trigger = AntdUI.Trigger.Hover; + this.dropdown_online.Type = AntdUI.TTypeMini.Primary; + this.dropdown_online.WaveSize = 0; + // + // dropdown_enable + // + this.dropdown_enable.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown_enable.Location = new System.Drawing.Point(94, 3); + this.dropdown_enable.Name = "dropdown_enable"; + this.dropdown_enable.ShowArrow = true; + this.dropdown_enable.Size = new System.Drawing.Size(85, 32); + this.dropdown_enable.TabIndex = 5; + this.dropdown_enable.Text = "启用状态"; + this.dropdown_enable.Trigger = AntdUI.Trigger.Hover; + this.dropdown_enable.Type = AntdUI.TTypeMini.Primary; + this.dropdown_enable.WaveSize = 0; + // + // dropdown_custom + // + this.dropdown_custom.BorderWidth = 2F; + this.dropdown_custom.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.dropdown_custom.Location = new System.Drawing.Point(185, 3); + this.dropdown_custom.Name = "dropdown_custom"; + this.dropdown_custom.ShowArrow = true; + this.dropdown_custom.Size = new System.Drawing.Size(85, 32); + this.dropdown_custom.TabIndex = 6; + this.dropdown_custom.Text = "自定义"; + this.dropdown_custom.Trigger = AntdUI.Trigger.Hover; + this.dropdown_custom.WaveSize = 0; + // + // DropDownDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "DropDownDemo"; + this.Size = new System.Drawing.Size(700, 806); + this.stackPanel1.ResumeLayout(false); + this.flowPanel6.ResumeLayout(false); + this.flowPanel5.ResumeLayout(false); + this.flowPanel1.ResumeLayout(false); + this.flowPanel2.ResumeLayout(false); + this.flowPanel3.ResumeLayout(false); + this.flowPanel4.ResumeLayout(false); + this.flowPanel7.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.Label label1; + private AntdUI.Label label2; + private AntdUI.Label label3; + private AntdUI.Label label4; + private AntdUI.Label label5; + private AntdUI.StackPanel stackPanel1; + private AntdUI.FlowPanel flowPanel6; + private AntdUI.Dropdown dropdown33; + private AntdUI.Dropdown dropdown32; + private AntdUI.Dropdown dropdown31; + private AntdUI.Dropdown dropdown30; + private AntdUI.Dropdown dropdown28; + private AntdUI.Dropdown dropdown34; + private AntdUI.Label label8; + private AntdUI.FlowPanel flowPanel5; + private AntdUI.Dropdown dropdown26; + private AntdUI.Dropdown dropdown25; + private AntdUI.Label label7; + private AntdUI.Divider divider1; + private AntdUI.FlowPanel flowPanel1; + private AntdUI.Dropdown dropdown1; + private AntdUI.Dropdown dropdown2; + private AntdUI.Label label6; + private AntdUI.Dropdown dropdown3; + private AntdUI.FlowPanel flowPanel2; + private AntdUI.Dropdown dropdown4; + private AntdUI.Dropdown dropdown5; + private AntdUI.Dropdown dropdown6; + private AntdUI.Label label9; + private AntdUI.Label label11; + private AntdUI.FlowPanel flowPanel3; + private AntdUI.Dropdown dropdown_multi; + private AntdUI.Label label10; + private AntdUI.FlowPanel flowPanel4; + private AntdUI.Dropdown dropdown_icon; + private AntdUI.FlowPanel flowPanel7; + private AntdUI.Dropdown dropdown_online; + private AntdUI.Label label12; + private AntdUI.Dropdown dropdown_custom; + private AntdUI.Dropdown dropdown_enable; + } +} diff --git a/Views/DropDownDemo.cs b/Views/DropDownDemo.cs new file mode 100644 index 0000000..2cdc8a1 --- /dev/null +++ b/Views/DropDownDemo.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AntdUIDemo.Views +{ + public partial class DropDownDemo : UserControl + { + public DropDownDemo() + { + InitializeComponent(); + InitData(); + } + + private void InitData() + { + dropdown_multi.Items.Clear(); + dropdown_multi.Items.AddRange(new AntdUI.SelectItem[] { + new AntdUI.SelectItem("first menu item"), + new AntdUI.SelectItem("second menu item"), + new AntdUI.SelectItem("third menu item") + { + Sub = new List{ + new AntdUI.SelectItem("子菜单1"){ + Sub=new List{ new AntdUI.SelectItem("sub menu") { + Sub=new List{ + "one st menu item","two nd menu item","three rd menu item" + } + } } + }, + new AntdUI.SelectItem( "子菜单2") + } + }, + new AntdUI.SelectItem("fourth menu item") { Sub = new List { "five menu item", "six six six menu item" } }, + }); + + dropdown_icon.Items.Clear(); + dropdown_icon.Items.AddRange(new AntdUI.SelectItem[] { + new AntdUI.SelectItem(Properties.Resources.关闭,"first menu item"), + new AntdUI.SelectItem("second menu item"){ + IconSvg = "", + }, + new AntdUI.SelectItem("third menu item"){ + IconSvg = "", + }, + }); + + dropdown_online.Items.Clear(); + dropdown_online.Items.AddRange(new AntdUI.SelectItem[] { + new AntdUI.SelectItem("first menu item"){ + Online = 1 + }, + new AntdUI.SelectItem("Second menu item"){ + Online = 0 + } + }); + + dropdown_enable.Items.Clear(); + dropdown_enable.Items.AddRange(new AntdUI.SelectItem[] { + new AntdUI.SelectItem("first menu item"){ + Online = 1, + Enable = true + }, + new AntdUI.SelectItem("Second menu item"){ + Online = 0, + }, + new AntdUI.SelectItem("Third menu item"){ + Online = 0, + Enable = false + } + }); + + dropdown_custom.Items.Clear(); + dropdown_custom.Items.AddRange(new AntdUI.SelectItem[] { + new AntdUI.SelectItem("first menu item"){ + Online = 1, + OnlineCustom = Color.Orange, + }, + new AntdUI.SelectItem("Second menu item"){ + Online = 1, + OnlineCustom = Color.Tan, + }, + new AntdUI.SelectItem("third menu item"){ + Online = 1, + OnlineCustom = Color.FromArgb(14,176,201), + }, + }); + + } + } +} diff --git a/Views/DropDownDemo.resx b/Views/DropDownDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/DropDownDemo.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Views/FloatButtonDemo.Designer.cs b/Views/FloatButtonDemo.Designer.cs index c2e7f34..7849b67 100644 --- a/Views/FloatButtonDemo.Designer.cs +++ b/Views/FloatButtonDemo.Designer.cs @@ -59,13 +59,13 @@ this.select_align = new AntdUI.Select(); this.label10 = new AntdUI.Label(); this.label4 = new AntdUI.Label(); - this.stackPanel2 = new AntdUI.StackPanel(); - this.buttonCZ = new AntdUI.Button(); - this.buttonClose = new AntdUI.Button(); this.divider1 = new AntdUI.Divider(); this.label3 = new AntdUI.Label(); this.label2 = new AntdUI.Label(); this.label1 = new AntdUI.Label(); + this.stackPanel2 = new AntdUI.StackPanel(); + this.buttonCZ = new AntdUI.Button(); + this.buttonClose = new AntdUI.Button(); this.stackPanel1.SuspendLayout(); this.stackPanel6.SuspendLayout(); this.stackPanel5.SuspendLayout(); @@ -76,13 +76,13 @@ // // stackPanel1 // + this.stackPanel1.Controls.Add(this.stackPanel2); this.stackPanel1.Controls.Add(this.stackPanel6); this.stackPanel1.Controls.Add(this.stackPanel5); this.stackPanel1.Controls.Add(this.label11); this.stackPanel1.Controls.Add(this.stackPanel4); this.stackPanel1.Controls.Add(this.stackPanel3); this.stackPanel1.Controls.Add(this.label4); - this.stackPanel1.Controls.Add(this.stackPanel2); this.stackPanel1.Controls.Add(this.divider1); this.stackPanel1.Controls.Add(this.label3); this.stackPanel1.Controls.Add(this.label2); @@ -103,7 +103,7 @@ this.stackPanel6.Controls.Add(this.label15); this.stackPanel6.Controls.Add(this.input_badge); this.stackPanel6.Controls.Add(this.label17); - this.stackPanel6.Location = new System.Drawing.Point(3, 345); + this.stackPanel6.Location = new System.Drawing.Point(3, 301); this.stackPanel6.Name = "stackPanel6"; this.stackPanel6.Size = new System.Drawing.Size(694, 32); this.stackPanel6.TabIndex = 20; @@ -177,7 +177,7 @@ this.stackPanel5.Controls.Add(this.label13); this.stackPanel5.Controls.Add(this.select_round); this.stackPanel5.Controls.Add(this.label14); - this.stackPanel5.Location = new System.Drawing.Point(3, 307); + this.stackPanel5.Location = new System.Drawing.Point(3, 263); this.stackPanel5.Name = "stackPanel5"; this.stackPanel5.Size = new System.Drawing.Size(694, 32); this.stackPanel5.TabIndex = 19; @@ -253,7 +253,7 @@ // label11 // this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); - this.label11.Location = new System.Drawing.Point(3, 277); + this.label11.Location = new System.Drawing.Point(3, 233); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(694, 24); this.label11.TabIndex = 18; @@ -267,7 +267,7 @@ this.stackPanel4.Controls.Add(this.label7); this.stackPanel4.Controls.Add(this.input_size); this.stackPanel4.Controls.Add(this.label9); - this.stackPanel4.Location = new System.Drawing.Point(3, 239); + this.stackPanel4.Location = new System.Drawing.Point(3, 195); this.stackPanel4.Name = "stackPanel4"; this.stackPanel4.Size = new System.Drawing.Size(694, 32); this.stackPanel4.TabIndex = 17; @@ -350,7 +350,7 @@ this.stackPanel3.Controls.Add(this.label6); this.stackPanel3.Controls.Add(this.select_align); this.stackPanel3.Controls.Add(this.label10); - this.stackPanel3.Location = new System.Drawing.Point(3, 201); + this.stackPanel3.Location = new System.Drawing.Point(3, 157); this.stackPanel3.Name = "stackPanel3"; this.stackPanel3.Size = new System.Drawing.Size(694, 32); this.stackPanel3.TabIndex = 16; @@ -427,44 +427,12 @@ // label4 // this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); - this.label4.Location = new System.Drawing.Point(3, 171); + this.label4.Location = new System.Drawing.Point(3, 127); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(694, 24); this.label4.TabIndex = 15; this.label4.Text = "控件配置"; // - // stackPanel2 - // - this.stackPanel2.Controls.Add(this.buttonCZ); - this.stackPanel2.Controls.Add(this.buttonClose); - this.stackPanel2.Location = new System.Drawing.Point(3, 127); - this.stackPanel2.Name = "stackPanel2"; - this.stackPanel2.Size = new System.Drawing.Size(694, 38); - this.stackPanel2.TabIndex = 14; - this.stackPanel2.Text = "stackPanel2"; - // - // buttonCZ - // - this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.buttonCZ.Location = new System.Drawing.Point(84, 3); - this.buttonCZ.Name = "buttonCZ"; - this.buttonCZ.Size = new System.Drawing.Size(75, 32); - this.buttonCZ.TabIndex = 4; - this.buttonCZ.Text = "重 置"; - this.buttonCZ.Type = AntdUI.TTypeMini.Warn; - this.buttonCZ.WaveSize = 0; - // - // buttonClose - // - this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.buttonClose.Location = new System.Drawing.Point(3, 3); - this.buttonClose.Name = "buttonClose"; - this.buttonClose.Size = new System.Drawing.Size(75, 32); - this.buttonClose.TabIndex = 3; - this.buttonClose.Text = "关 闭"; - this.buttonClose.Type = AntdUI.TTypeMini.Error; - this.buttonClose.WaveSize = 0; - // // divider1 // this.divider1.Location = new System.Drawing.Point(3, 109); @@ -499,6 +467,38 @@ this.label1.TabIndex = 2; this.label1.Text = "FloatButton 悬浮按钮"; // + // stackPanel2 + // + this.stackPanel2.Controls.Add(this.buttonCZ); + this.stackPanel2.Controls.Add(this.buttonClose); + this.stackPanel2.Location = new System.Drawing.Point(3, 339); + this.stackPanel2.Name = "stackPanel2"; + this.stackPanel2.Size = new System.Drawing.Size(694, 38); + this.stackPanel2.TabIndex = 21; + this.stackPanel2.Text = "stackPanel2"; + // + // buttonCZ + // + this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.buttonCZ.Location = new System.Drawing.Point(84, 3); + this.buttonCZ.Name = "buttonCZ"; + this.buttonCZ.Size = new System.Drawing.Size(75, 32); + this.buttonCZ.TabIndex = 4; + this.buttonCZ.Text = "重 置"; + this.buttonCZ.Type = AntdUI.TTypeMini.Warn; + this.buttonCZ.WaveSize = 0; + // + // buttonClose + // + this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.buttonClose.Location = new System.Drawing.Point(3, 3); + this.buttonClose.Name = "buttonClose"; + this.buttonClose.Size = new System.Drawing.Size(75, 32); + this.buttonClose.TabIndex = 3; + this.buttonClose.Text = "关 闭"; + this.buttonClose.Type = AntdUI.TTypeMini.Error; + this.buttonClose.WaveSize = 0; + // // FloatButtonDemo // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -552,9 +552,9 @@ private AntdUI.Select select_align; private AntdUI.Label label10; private AntdUI.Label label4; + private AntdUI.Divider divider1; private AntdUI.StackPanel stackPanel2; private AntdUI.Button buttonCZ; private AntdUI.Button buttonClose; - private AntdUI.Divider divider1; } } diff --git a/Views/FloatButtonDemo.cs b/Views/FloatButtonDemo.cs index 75d8854..1d6fe87 100644 --- a/Views/FloatButtonDemo.cs +++ b/Views/FloatButtonDemo.cs @@ -98,7 +98,7 @@ namespace AntdUIDemo.Views IconSvg = "", Round = select_round.SelectedIndex == 0, Type = (TTypeMini)select_type.SelectedValue, - Radius = Convert.ToInt32(input_radius.Value), + Radius = (int)input_radius.Value, Badge = input_badge.Text, BadgeSize = (float)input_badgesize.Value, BadgeBack = colorPicker.Value, @@ -109,7 +109,7 @@ namespace AntdUIDemo.Views Tooltip = "资源图片按钮", Round = select_round.SelectedIndex == 0, Type = (TTypeMini)select_type.SelectedValue, - Radius = Convert.ToInt32(input_radius.Value), + Radius = (int)input_radius.Value, Badge = input_badge.Text, BadgeSize = (float)input_badgesize.Value, BadgeBack = colorPicker.Value, @@ -120,7 +120,7 @@ namespace AntdUIDemo.Views Tooltip = "文本按钮", Round = select_round.SelectedIndex == 0, Type = (TTypeMini)select_type.SelectedValue, - Radius = Convert.ToInt32(input_radius.Value), + Radius = (int)input_radius.Value, Badge = input_badge.Text, BadgeSize = (float)input_badgesize.Value, BadgeBack = colorPicker.Value, @@ -144,11 +144,11 @@ namespace AntdUIDemo.Views //是否置顶 TopMost = select_topmost.SelectedIndex == 0, //尺寸大小 - Size = Convert.ToInt32(input_size.Value), + Size = (int)input_size.Value, //相对于Align位置X轴偏移 - MarginX = Convert.ToInt32(input_mx.Value), + MarginX = (int)input_mx.Value, //相对于Align位置Y轴偏移 - MarginY = Convert.ToInt32(input_my.Value), + MarginY = (int)input_my.Value, }); } } @@ -164,20 +164,6 @@ namespace AntdUIDemo.Views } } - // 重置 - private void buttonCZ_Click(object sender, EventArgs e) - { - InitData(); - CloseFloatButtonForm(); - LoadFloatButton(); - } - - // 关闭 - private void buttonClose_Click(object sender, EventArgs e) - { - CloseFloatButtonForm(); - } - #region EventHandler private void select_intvalue_SelectedIndexChanged(object sender, int value) { @@ -202,6 +188,20 @@ namespace AntdUIDemo.Views CloseFloatButtonForm(); LoadFloatButton(); } + + // 重置 + private void buttonCZ_Click(object sender, EventArgs e) + { + InitData(); + CloseFloatButtonForm(); + LoadFloatButton(); + } + + // 关闭 + private void buttonClose_Click(object sender, EventArgs e) + { + CloseFloatButtonForm(); + } #endregion diff --git a/Views/FlowPanelDemo.cs b/Views/FlowPanelDemo.cs index 447460c..aad1a12 100644 --- a/Views/FlowPanelDemo.cs +++ b/Views/FlowPanelDemo.cs @@ -72,17 +72,6 @@ namespace AntdUIDemo.Views input_gap.ValueChanged += input_gap_ValueChanged; } - private void select_intvalue_SelectedIndexChanged(object sender, int value) - { - flowPanel.Align = (TAlignFlow)select_align.SelectedValue; - flowPanel.AutoScroll = select_autoscroll.SelectedIndex == 0; - } - - private void input_gap_ValueChanged(object sender, decimal value) - { - flowPanel.Gap = (int)input_gap.Value; - } - // 初始化下拉框 private void InitSelectItems() { @@ -93,7 +82,17 @@ namespace AntdUIDemo.Views select_align.Items.Add(align); } } + #region 事件 + private void select_intvalue_SelectedIndexChanged(object sender, int value) + { + flowPanel.Align = (TAlignFlow)select_align.SelectedValue; + flowPanel.AutoScroll = select_autoscroll.SelectedIndex == 0; + } + private void input_gap_ValueChanged(object sender, decimal value) + { + flowPanel.Gap = (int)input_gap.Value; + } // 添加按钮 private void buttonADD_Click(object sender, EventArgs e) { @@ -126,6 +125,7 @@ namespace AntdUIDemo.Views InitData(); LoadFlowPanel(); } + #endregion } } diff --git a/Views/GridPanelDemo.cs b/Views/GridPanelDemo.cs index 0406c03..5449551 100644 --- a/Views/GridPanelDemo.cs +++ b/Views/GridPanelDemo.cs @@ -35,16 +35,6 @@ namespace AntdUIDemo.Views input_gap.ValueChanged += input_gap_ValueChanged; } - private void input_gap_ValueChanged(object sender, decimal value) - { - LoadGridPanel(input_span.Text, input_gap.Value); - } - - private void input_span_TextChanged(object sender, EventArgs e) - { - LoadGridPanel(input_span.Text, input_gap.Value); - } - private void LoadGridPanel(string spantext, decimal gap) { gridPanel.Controls.Clear(); @@ -63,11 +53,22 @@ namespace AntdUIDemo.Views } } + #region 事件 + private void input_gap_ValueChanged(object sender, decimal value) + { + LoadGridPanel(input_span.Text, input_gap.Value); + } + + private void input_span_TextChanged(object sender, EventArgs e) + { + LoadGridPanel(input_span.Text, input_gap.Value); + } + private void buttonCZ_Click(object sender, EventArgs e) { InitData(); LoadGridPanel(input_span.Text, 0); } - + #endregion } } diff --git a/Views/PanelDemo.Designer.cs b/Views/PanelDemo.Designer.cs index 67a16f1..107e690 100644 --- a/Views/PanelDemo.Designer.cs +++ b/Views/PanelDemo.Designer.cs @@ -139,7 +139,7 @@ this.panel.Name = "panel"; this.panel.Shadow = 12; this.panel.ShadowOpacityAnimation = true; - this.panel.Size = new System.Drawing.Size(360, 260); + this.panel.Size = new System.Drawing.Size(360, 298); this.panel.TabIndex = 35; this.panel.Text = "panel1"; // diff --git a/Views/PanelDemo.cs b/Views/PanelDemo.cs index ac2b7c8..f3fd64f 100644 --- a/Views/PanelDemo.cs +++ b/Views/PanelDemo.cs @@ -56,13 +56,6 @@ namespace AntdUIDemo.Views } } - // 重置 - private void buttonCZ_Click(object sender, EventArgs e) - { - InitData(); - LoadPanel(); - } - // 设置默认值 private void InitData() { @@ -121,6 +114,13 @@ namespace AntdUIDemo.Views { LoadPanel(); } + + // 重置 + private void buttonCZ_Click(object sender, EventArgs e) + { + InitData(); + LoadPanel(); + } #endregion }