diff --git a/MainWindow.cs b/MainWindow.cs index d51dcf7..392a4a1 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -236,6 +236,9 @@ namespace AntdUIDemo case "Carousel": control = new CarouselDemo(); break; + case "Collapse": + control = new CollapseDemo(); + break; case "Label": control = new LabelDemo(); break; diff --git a/Models/DataUtil.cs b/Models/DataUtil.cs index b20f899..26b513b 100644 --- a/Models/DataUtil.cs +++ b/Models/DataUtil.cs @@ -58,6 +58,7 @@ namespace AntdUIDemo.Models new MenuItems { Text = "Badge 徽标数", Tag = "Badge"}, new MenuItems { Text = "Calendar 日历", Tag = "Calendar"}, new MenuItems { Text = "Carousel 走马灯", Tag = "Carousel"}, + new MenuItems { Text = "Collapse 折叠面板", Tag = "Collapse"}, new MenuItems { Text = "Label 标签", Tag = "Label"}, new MenuItems { Text = "Popover 气泡卡片", Tag = "Popover"}, new MenuItems { Text = "Preview 图片预览", Tag = "Preview"}, diff --git a/README.md b/README.md index 7172252..475e9cf 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ ![Calendar](assets/screenshots/Calendar.png) #### Carousel 走马灯 ![Carousel](assets/screenshots/Carousel.png) +#### Collapse 折叠面板 +![Collapse](assets/screenshots/Collapse.png) #### Label 标签 ![Label](assets/screenshots/Label.png) #### Popover 气泡卡片 diff --git a/Views/CollapseDemo.Designer.cs b/Views/CollapseDemo.Designer.cs new file mode 100644 index 0000000..523597f --- /dev/null +++ b/Views/CollapseDemo.Designer.cs @@ -0,0 +1,405 @@ +namespace AntdUIDemo.Views +{ + partial class CollapseDemo + { + /// + /// 必需的设计器变量。 + /// + 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.stackPanel1 = new AntdUI.StackPanel(); + this.collapse1 = new AntdUI.Collapse(); + this.collapseItem1 = new AntdUI.CollapseItem(); + this.label3 = new AntdUI.Label(); + this.collapseItem2 = new AntdUI.CollapseItem(); + this.collapseItem3 = new AntdUI.CollapseItem(); + this.label4 = new AntdUI.Label(); + this.divider1 = new AntdUI.Divider(); + this.label2 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); + this.label8 = new AntdUI.Label(); + this.collapse3 = new AntdUI.Collapse(); + this.collapseItem6 = new AntdUI.CollapseItem(); + this.label9 = new AntdUI.Label(); + this.collapseItem7 = new AntdUI.CollapseItem(); + this.label10 = new AntdUI.Label(); + this.collapseItem8 = new AntdUI.CollapseItem(); + this.label11 = new AntdUI.Label(); + this.flowPanel1 = new AntdUI.FlowPanel(); + this.button11 = new AntdUI.Button(); + this.button12 = new AntdUI.Button(); + this.button13 = new AntdUI.Button(); + this.button14 = new AntdUI.Button(); + this.button15 = new AntdUI.Button(); + this.button16 = new AntdUI.Button(); + this.progress1 = new AntdUI.Progress(); + this.stackPanel1.SuspendLayout(); + this.collapse1.SuspendLayout(); + this.collapseItem1.SuspendLayout(); + this.collapseItem2.SuspendLayout(); + this.collapseItem3.SuspendLayout(); + this.collapse3.SuspendLayout(); + this.collapseItem6.SuspendLayout(); + this.collapseItem7.SuspendLayout(); + this.collapseItem8.SuspendLayout(); + this.flowPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.collapse3); + this.stackPanel1.Controls.Add(this.label8); + this.stackPanel1.Controls.Add(this.collapse1); + this.stackPanel1.Controls.Add(this.label4); + this.stackPanel1.Controls.Add(this.divider1); + 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, 682); + this.stackPanel1.TabIndex = 0; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // collapse1 + // + this.collapse1.Controls.Add(this.collapseItem1); + this.collapse1.Controls.Add(this.collapseItem2); + this.collapse1.Controls.Add(this.collapseItem3); + this.collapse1.Cursor = System.Windows.Forms.Cursors.Hand; + this.collapse1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.collapse1.Items.Add(this.collapseItem1); + this.collapse1.Items.Add(this.collapseItem2); + this.collapse1.Items.Add(this.collapseItem3); + this.collapse1.Location = new System.Drawing.Point(3, 127); + this.collapse1.Name = "collapse1"; + this.collapse1.Size = new System.Drawing.Size(694, 266); + this.collapse1.TabIndex = 47; + this.collapse1.Text = "collapse1"; + this.collapse1.Unique = true; + // + // collapseItem1 + // + this.collapseItem1.Controls.Add(this.label3); + this.collapseItem1.Expand = true; + this.collapseItem1.Location = new System.Drawing.Point(19, 60); + this.collapseItem1.Name = "collapseItem1"; + this.collapseItem1.Size = new System.Drawing.Size(656, 65); + this.collapseItem1.TabIndex = 0; + this.collapseItem1.Text = "This is panel header 1"; + // + // label3 + // + this.label3.Dock = System.Windows.Forms.DockStyle.Fill; + this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label3.Location = new System.Drawing.Point(0, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(656, 65); + this.label3.TabIndex = 0; + this.label3.Text = "A dog is a type of domesticated animal. Known for its loyalty and faithfulness, i" + + "t can be found as a welcome guest in many households across the world."; + // + // collapseItem2 + // + this.collapseItem2.Controls.Add(this.progress1); + this.collapseItem2.Location = new System.Drawing.Point(-656, -60); + this.collapseItem2.Name = "collapseItem2"; + this.collapseItem2.Size = new System.Drawing.Size(656, 60); + this.collapseItem2.TabIndex = 1; + this.collapseItem2.Text = "This is panel header 2"; + // + // collapseItem3 + // + this.collapseItem3.Controls.Add(this.flowPanel1); + this.collapseItem3.Location = new System.Drawing.Point(-656, -92); + this.collapseItem3.Name = "collapseItem3"; + this.collapseItem3.Size = new System.Drawing.Size(656, 92); + this.collapseItem3.TabIndex = 2; + this.collapseItem3.Text = "This is panel header 3"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(3, 97); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(694, 24); + this.label4.TabIndex = 46; + this.label4.Text = "基本用法"; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 79); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 45; + // + // 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 = 44; + this.label2.Text = "可以折叠/展开的内容区域。"; + // + // 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 = 43; + this.label1.Text = "Collapse 折叠面板"; + // + // 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, 399); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(694, 24); + this.label8.TabIndex = 48; + this.label8.Text = "无边框"; + // + // collapse3 + // + this.collapse3.BorderWidth = 0F; + this.collapse3.Controls.Add(this.collapseItem6); + this.collapse3.Controls.Add(this.collapseItem7); + this.collapse3.Controls.Add(this.collapseItem8); + this.collapse3.Cursor = System.Windows.Forms.Cursors.Hand; + this.collapse3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.collapse3.Items.Add(this.collapseItem6); + this.collapse3.Items.Add(this.collapseItem7); + this.collapse3.Items.Add(this.collapseItem8); + this.collapse3.Location = new System.Drawing.Point(3, 429); + this.collapse3.Name = "collapse3"; + this.collapse3.Size = new System.Drawing.Size(694, 247); + this.collapse3.TabIndex = 49; + this.collapse3.Text = "collapse3"; + this.collapse3.Unique = true; + // + // collapseItem6 + // + this.collapseItem6.Controls.Add(this.label9); + this.collapseItem6.Location = new System.Drawing.Point(-656, -65); + this.collapseItem6.Name = "collapseItem6"; + this.collapseItem6.Size = new System.Drawing.Size(656, 65); + this.collapseItem6.TabIndex = 0; + this.collapseItem6.Text = "This is panel header 1"; + // + // label9 + // + this.label9.Dock = System.Windows.Forms.DockStyle.Fill; + this.label9.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label9.Location = new System.Drawing.Point(0, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(656, 65); + this.label9.TabIndex = 0; + this.label9.Text = "A dog is a type of domesticated animal. Known for its loyalty and faithfulness, i" + + "t can be found as a welcome guest in many households across the world."; + // + // collapseItem7 + // + this.collapseItem7.Controls.Add(this.label10); + this.collapseItem7.Location = new System.Drawing.Point(-656, -60); + this.collapseItem7.Name = "collapseItem7"; + this.collapseItem7.Size = new System.Drawing.Size(656, 60); + this.collapseItem7.TabIndex = 1; + this.collapseItem7.Text = "This is panel header 2"; + // + // label10 + // + this.label10.Dock = System.Windows.Forms.DockStyle.Fill; + this.label10.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label10.Location = new System.Drawing.Point(0, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(656, 60); + this.label10.TabIndex = 1; + this.label10.Text = "A dog is a type of domesticated animal. Known for its loyalty and faithfulness, i" + + "t can be found as a welcome guest in many households across the world."; + // + // collapseItem8 + // + this.collapseItem8.Controls.Add(this.label11); + this.collapseItem8.Location = new System.Drawing.Point(-656, -77); + this.collapseItem8.Name = "collapseItem8"; + this.collapseItem8.Size = new System.Drawing.Size(656, 77); + this.collapseItem8.TabIndex = 2; + this.collapseItem8.Text = "This is panel header 3"; + // + // label11 + // + this.label11.Dock = System.Windows.Forms.DockStyle.Fill; + this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.label11.Location = new System.Drawing.Point(0, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(656, 77); + this.label11.TabIndex = 2; + this.label11.Text = "A dog is a type of domesticated animal. Known for its loyalty and faithfulness, i" + + "t can be found as a welcome guest in many households across the world."; + // + // flowPanel1 + // + this.flowPanel1.Controls.Add(this.button11); + this.flowPanel1.Controls.Add(this.button12); + this.flowPanel1.Controls.Add(this.button13); + this.flowPanel1.Controls.Add(this.button14); + this.flowPanel1.Controls.Add(this.button15); + this.flowPanel1.Controls.Add(this.button16); + this.flowPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowPanel1.Location = new System.Drawing.Point(0, 0); + this.flowPanel1.Name = "flowPanel1"; + this.flowPanel1.Size = new System.Drawing.Size(656, 92); + this.flowPanel1.TabIndex = 7; + this.flowPanel1.Text = "flowPanel1"; + // + // button11 + // + this.button11.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button11.Location = new System.Drawing.Point(433, 3); + this.button11.Name = "button11"; + this.button11.Size = new System.Drawing.Size(80, 32); + this.button11.TabIndex = 5; + this.button11.Text = "Info"; + this.button11.Type = AntdUI.TTypeMini.Info; + this.button11.WaveSize = 0; + // + // button12 + // + this.button12.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button12.Location = new System.Drawing.Point(347, 3); + this.button12.Name = "button12"; + this.button12.Size = new System.Drawing.Size(80, 32); + this.button12.TabIndex = 4; + this.button12.Text = "Error"; + this.button12.Type = AntdUI.TTypeMini.Error; + this.button12.WaveSize = 0; + // + // button13 + // + this.button13.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button13.Location = new System.Drawing.Point(261, 3); + this.button13.Name = "button13"; + this.button13.Size = new System.Drawing.Size(80, 32); + this.button13.TabIndex = 3; + this.button13.Text = "Warn"; + this.button13.Type = AntdUI.TTypeMini.Warn; + this.button13.WaveSize = 0; + // + // button14 + // + this.button14.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button14.Location = new System.Drawing.Point(175, 3); + this.button14.Name = "button14"; + this.button14.Size = new System.Drawing.Size(80, 32); + this.button14.TabIndex = 2; + this.button14.Text = "Success"; + this.button14.Type = AntdUI.TTypeMini.Success; + this.button14.WaveSize = 0; + // + // button15 + // + this.button15.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button15.Location = new System.Drawing.Point(89, 3); + this.button15.Name = "button15"; + this.button15.Size = new System.Drawing.Size(80, 32); + this.button15.TabIndex = 1; + this.button15.Text = "Primary"; + this.button15.Type = AntdUI.TTypeMini.Primary; + this.button15.WaveSize = 0; + // + // button16 + // + this.button16.Cursor = System.Windows.Forms.Cursors.Default; + this.button16.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button16.Location = new System.Drawing.Point(3, 3); + this.button16.Name = "button16"; + this.button16.Size = new System.Drawing.Size(80, 32); + this.button16.TabIndex = 0; + this.button16.Text = "Default"; + this.button16.WaveSize = 0; + // + // progress1 + // + this.progress1.Dock = System.Windows.Forms.DockStyle.Fill; + this.progress1.Loading = true; + this.progress1.Location = new System.Drawing.Point(0, 0); + this.progress1.Name = "progress1"; + this.progress1.ShowText = true; + this.progress1.Size = new System.Drawing.Size(656, 60); + this.progress1.TabIndex = 0; + this.progress1.Text = "%"; + this.progress1.Value = 0.5F; + // + // CollapseDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "CollapseDemo"; + this.Size = new System.Drawing.Size(700, 682); + this.stackPanel1.ResumeLayout(false); + this.collapse1.ResumeLayout(false); + this.collapseItem1.ResumeLayout(false); + this.collapseItem2.ResumeLayout(false); + this.collapseItem3.ResumeLayout(false); + this.collapse3.ResumeLayout(false); + this.collapseItem6.ResumeLayout(false); + this.collapseItem7.ResumeLayout(false); + this.collapseItem8.ResumeLayout(false); + this.flowPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.StackPanel stackPanel1; + private AntdUI.Label label4; + private AntdUI.Divider divider1; + private AntdUI.Label label2; + private AntdUI.Label label1; + private AntdUI.Collapse collapse1; + private AntdUI.CollapseItem collapseItem1; + private AntdUI.CollapseItem collapseItem2; + private AntdUI.CollapseItem collapseItem3; + private AntdUI.Label label3; + private AntdUI.Label label8; + private AntdUI.Collapse collapse3; + private AntdUI.CollapseItem collapseItem6; + private AntdUI.Label label9; + private AntdUI.CollapseItem collapseItem7; + private AntdUI.Label label10; + private AntdUI.CollapseItem collapseItem8; + private AntdUI.Label label11; + private AntdUI.Progress progress1; + private AntdUI.FlowPanel flowPanel1; + private AntdUI.Button button11; + private AntdUI.Button button12; + private AntdUI.Button button13; + private AntdUI.Button button14; + private AntdUI.Button button15; + private AntdUI.Button button16; + } +} diff --git a/Views/CollapseDemo.cs b/Views/CollapseDemo.cs new file mode 100644 index 0000000..f16d206 --- /dev/null +++ b/Views/CollapseDemo.cs @@ -0,0 +1,20 @@ +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 CollapseDemo : UserControl + { + public CollapseDemo() + { + InitializeComponent(); + } + } +} diff --git a/Views/CollapseDemo.resx b/Views/CollapseDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/CollapseDemo.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/assets/screenshots/Collapse.png b/assets/screenshots/Collapse.png new file mode 100644 index 0000000..be80d3b Binary files /dev/null and b/assets/screenshots/Collapse.png differ