新增Collapse折叠面板

This commit is contained in:
czz_y 2024-09-14 13:56:30 +08:00
parent c888cc778c
commit 4abd917f46
7 changed files with 551 additions and 0 deletions

View File

@ -236,6 +236,9 @@ namespace AntdUIDemo
case "Carousel":
control = new CarouselDemo();
break;
case "Collapse":
control = new CollapseDemo();
break;
case "Label":
control = new LabelDemo();
break;

View File

@ -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"},

View File

@ -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 气泡卡片

405
Views/CollapseDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,405 @@
namespace AntdUIDemo.Views
{
partial class CollapseDemo
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
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;
}
}

20
Views/CollapseDemo.cs Normal file
View File

@ -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();
}
}
}

120
Views/CollapseDemo.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB