添加Battery, Chatlist, Msglist, Spin

This commit is contained in:
czz_y 2024-09-06 14:37:58 +08:00
parent ec62c7459a
commit 4aee0c189f
19 changed files with 2111 additions and 31 deletions

View File

@ -110,7 +110,6 @@ namespace AntdUIDemo
{
using (var form = new SystemSet(this))
{
//AutoDpi(form);
AntdUI.Modal.open(new AntdUI.Modal.Config(this, "系统设置", form, TType.Info)
{
CloseIcon = true,
@ -286,6 +285,21 @@ namespace AntdUIDemo
case "Progress":
control = new ProgressDemo();
break;
case "Spin":
control = new SpinDemo(this);
break;
case "ChatList":
control = new ChatListDemo();
break;
case "MsgList":
control = new MsgListDemo();
break;
case "Battery":
control = new BatteryDemo();
break;
case "ContextMenuStrip":
control = new ContextMenuStripDemo(this);
break;
default:
break;
}

View File

@ -18,6 +18,7 @@ namespace AntdUIDemo.Models
},
{ "布局", new List<MenuItems>
{
new MenuItems { Text = "Divider 分割线", Tag = "Divider" },
new MenuItems { Text = "FlowPanel 流动布局", Tag = "FlowPanel"},
new MenuItems { Text = "GridPanel 网格布局", Tag = "GridPanel"},
new MenuItems { Text = "Panel 面板", Tag = "Panel"},
@ -89,7 +90,6 @@ namespace AntdUIDemo.Models
{
new MenuItems { Text = "Battery 电池", Tag = "Battery" },
new MenuItems { Text = "ContextMenuStrip 右键菜单", Tag = "ContextMenuStrip" },
new MenuItems { Text = "Divider 分割线", Tag = "Divider" },
new MenuItems { Text = "Image3D 图片3D", Tag = "Image3D" },
new MenuItems { Text = "WindowBar 窗口栏", Tag = "WindowBar" }
}

488
Views/BatteryDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,488 @@
namespace AntdUIDemo.Views
{
partial class BatteryDemo
{
/// <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.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.flowPanel = new AntdUI.FlowPanel();
this.label4 = new AntdUI.Label();
this.battery5 = new AntdUI.Battery();
this.battery6 = new AntdUI.Battery();
this.battery4 = new AntdUI.Battery();
this.battery2 = new AntdUI.Battery();
this.battery1 = new AntdUI.Battery();
this.label3 = new AntdUI.Label();
this.flowPanel1 = new AntdUI.FlowPanel();
this.battery3 = new AntdUI.Battery();
this.battery7 = new AntdUI.Battery();
this.battery8 = new AntdUI.Battery();
this.battery9 = new AntdUI.Battery();
this.battery10 = new AntdUI.Battery();
this.label6 = new AntdUI.Label();
this.flowPanel3 = new AntdUI.FlowPanel();
this.battery16 = new AntdUI.Battery();
this.battery17 = new AntdUI.Battery();
this.battery18 = new AntdUI.Battery();
this.battery19 = new AntdUI.Battery();
this.battery20 = new AntdUI.Battery();
this.flowPanel2 = new AntdUI.FlowPanel();
this.battery14 = new AntdUI.Battery();
this.battery13 = new AntdUI.Battery();
this.battery12 = new AntdUI.Battery();
this.battery11 = new AntdUI.Battery();
this.battery15 = new AntdUI.Battery();
this.label5 = new AntdUI.Label();
this.stackPanel1.SuspendLayout();
this.flowPanel.SuspendLayout();
this.flowPanel1.SuspendLayout();
this.flowPanel3.SuspendLayout();
this.flowPanel2.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.flowPanel2);
this.stackPanel1.Controls.Add(this.label5);
this.stackPanel1.Controls.Add(this.flowPanel3);
this.stackPanel1.Controls.Add(this.label6);
this.stackPanel1.Controls.Add(this.flowPanel1);
this.stackPanel1.Controls.Add(this.label3);
this.stackPanel1.Controls.Add(this.flowPanel);
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, 481);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// 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 = 34;
//
// 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 = 33;
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 = 32;
this.label1.Text = "Battery 电池";
//
// flowPanel
//
this.flowPanel.Controls.Add(this.battery1);
this.flowPanel.Controls.Add(this.battery2);
this.flowPanel.Controls.Add(this.battery4);
this.flowPanel.Controls.Add(this.battery6);
this.flowPanel.Controls.Add(this.battery5);
this.flowPanel.Location = new System.Drawing.Point(3, 127);
this.flowPanel.Name = "flowPanel";
this.flowPanel.Size = new System.Drawing.Size(694, 38);
this.flowPanel.TabIndex = 52;
this.flowPanel.Text = "flowPanel1";
//
// 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 = 51;
this.label4.Text = "基本用法";
//
// battery5
//
this.battery5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery5.Location = new System.Drawing.Point(3, 3);
this.battery5.Name = "battery5";
this.battery5.Size = new System.Drawing.Size(60, 32);
this.battery5.TabIndex = 6;
this.battery5.Text = "battery5";
this.battery5.Value = 10;
//
// battery6
//
this.battery6.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery6.Location = new System.Drawing.Point(69, 3);
this.battery6.Name = "battery6";
this.battery6.Size = new System.Drawing.Size(60, 32);
this.battery6.TabIndex = 7;
this.battery6.Text = "battery6";
this.battery6.Value = 30;
//
// battery4
//
this.battery4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery4.Location = new System.Drawing.Point(135, 3);
this.battery4.Name = "battery4";
this.battery4.Size = new System.Drawing.Size(60, 32);
this.battery4.TabIndex = 8;
this.battery4.Text = "battery4";
this.battery4.Value = 50;
//
// battery2
//
this.battery2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery2.Location = new System.Drawing.Point(201, 3);
this.battery2.Name = "battery2";
this.battery2.Size = new System.Drawing.Size(60, 32);
this.battery2.TabIndex = 9;
this.battery2.Text = "battery2";
this.battery2.Value = 70;
//
// battery1
//
this.battery1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery1.Location = new System.Drawing.Point(267, 3);
this.battery1.Name = "battery1";
this.battery1.Size = new System.Drawing.Size(60, 32);
this.battery1.TabIndex = 10;
this.battery1.Text = "battery1";
this.battery1.Value = 100;
//
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(3, 171);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(694, 24);
this.label3.TabIndex = 54;
this.label3.Text = "无文字";
//
// flowPanel1
//
this.flowPanel1.Controls.Add(this.battery3);
this.flowPanel1.Controls.Add(this.battery7);
this.flowPanel1.Controls.Add(this.battery8);
this.flowPanel1.Controls.Add(this.battery9);
this.flowPanel1.Controls.Add(this.battery10);
this.flowPanel1.Location = new System.Drawing.Point(3, 201);
this.flowPanel1.Name = "flowPanel1";
this.flowPanel1.Size = new System.Drawing.Size(694, 38);
this.flowPanel1.TabIndex = 55;
this.flowPanel1.Text = "flowPanel1";
//
// battery3
//
this.battery3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery3.Location = new System.Drawing.Point(267, 3);
this.battery3.Name = "battery3";
this.battery3.ShowText = false;
this.battery3.Size = new System.Drawing.Size(60, 32);
this.battery3.TabIndex = 10;
this.battery3.Text = "battery3";
this.battery3.Value = 100;
//
// battery7
//
this.battery7.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery7.Location = new System.Drawing.Point(201, 3);
this.battery7.Name = "battery7";
this.battery7.ShowText = false;
this.battery7.Size = new System.Drawing.Size(60, 32);
this.battery7.TabIndex = 9;
this.battery7.Text = "battery7";
this.battery7.Value = 70;
//
// battery8
//
this.battery8.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery8.Location = new System.Drawing.Point(135, 3);
this.battery8.Name = "battery8";
this.battery8.ShowText = false;
this.battery8.Size = new System.Drawing.Size(60, 32);
this.battery8.TabIndex = 8;
this.battery8.Text = "battery8";
this.battery8.Value = 50;
//
// battery9
//
this.battery9.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery9.Location = new System.Drawing.Point(69, 3);
this.battery9.Name = "battery9";
this.battery9.ShowText = false;
this.battery9.Size = new System.Drawing.Size(60, 32);
this.battery9.TabIndex = 7;
this.battery9.Text = "battery9";
this.battery9.Value = 30;
//
// battery10
//
this.battery10.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery10.Location = new System.Drawing.Point(3, 3);
this.battery10.Name = "battery10";
this.battery10.ShowText = false;
this.battery10.Size = new System.Drawing.Size(60, 32);
this.battery10.TabIndex = 6;
this.battery10.Text = "battery10";
this.battery10.Value = 10;
//
// 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, 245);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(694, 24);
this.label6.TabIndex = 58;
this.label6.Text = "点形状";
//
// flowPanel3
//
this.flowPanel3.Controls.Add(this.battery16);
this.flowPanel3.Controls.Add(this.battery17);
this.flowPanel3.Controls.Add(this.battery18);
this.flowPanel3.Controls.Add(this.battery19);
this.flowPanel3.Controls.Add(this.battery20);
this.flowPanel3.Location = new System.Drawing.Point(3, 275);
this.flowPanel3.Name = "flowPanel3";
this.flowPanel3.Size = new System.Drawing.Size(694, 38);
this.flowPanel3.TabIndex = 59;
this.flowPanel3.Text = "flowPanel3";
//
// battery16
//
this.battery16.DotSize = 10;
this.battery16.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery16.Location = new System.Drawing.Point(267, 3);
this.battery16.Name = "battery16";
this.battery16.ShowText = false;
this.battery16.Size = new System.Drawing.Size(60, 32);
this.battery16.TabIndex = 10;
this.battery16.Text = "battery16";
this.battery16.Value = 100;
//
// battery17
//
this.battery17.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery17.Location = new System.Drawing.Point(201, 3);
this.battery17.Name = "battery17";
this.battery17.ShowText = false;
this.battery17.Size = new System.Drawing.Size(60, 32);
this.battery17.TabIndex = 9;
this.battery17.Text = "battery17";
this.battery17.Value = 100;
//
// battery18
//
this.battery18.DotSize = 6;
this.battery18.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery18.Location = new System.Drawing.Point(135, 3);
this.battery18.Name = "battery18";
this.battery18.ShowText = false;
this.battery18.Size = new System.Drawing.Size(60, 32);
this.battery18.TabIndex = 8;
this.battery18.Text = "battery18";
this.battery18.Value = 100;
//
// battery19
//
this.battery19.DotSize = 4;
this.battery19.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery19.Location = new System.Drawing.Point(69, 3);
this.battery19.Name = "battery19";
this.battery19.ShowText = false;
this.battery19.Size = new System.Drawing.Size(60, 32);
this.battery19.TabIndex = 7;
this.battery19.Text = "battery19";
this.battery19.Value = 100;
//
// battery20
//
this.battery20.DotSize = 0;
this.battery20.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery20.Location = new System.Drawing.Point(3, 3);
this.battery20.Name = "battery20";
this.battery20.ShowText = false;
this.battery20.Size = new System.Drawing.Size(60, 32);
this.battery20.TabIndex = 6;
this.battery20.Text = "battery20";
this.battery20.Value = 100;
//
// flowPanel2
//
this.flowPanel2.Controls.Add(this.battery14);
this.flowPanel2.Controls.Add(this.battery13);
this.flowPanel2.Controls.Add(this.battery12);
this.flowPanel2.Controls.Add(this.battery11);
this.flowPanel2.Controls.Add(this.battery15);
this.flowPanel2.Location = new System.Drawing.Point(3, 349);
this.flowPanel2.Name = "flowPanel2";
this.flowPanel2.Size = new System.Drawing.Size(694, 38);
this.flowPanel2.TabIndex = 61;
this.flowPanel2.Text = "flowPanel2";
//
// battery14
//
this.battery14.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121)))));
this.battery14.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79)))));
this.battery14.FillWarn = System.Drawing.Color.Fuchsia;
this.battery14.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery14.Location = new System.Drawing.Point(267, 3);
this.battery14.Name = "battery14";
this.battery14.ShowText = false;
this.battery14.Size = new System.Drawing.Size(60, 32);
this.battery14.TabIndex = 10;
this.battery14.Text = "battery14";
this.battery14.Value = 100;
//
// battery13
//
this.battery13.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121)))));
this.battery13.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79)))));
this.battery13.FillWarn = System.Drawing.Color.Fuchsia;
this.battery13.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery13.Location = new System.Drawing.Point(201, 3);
this.battery13.Name = "battery13";
this.battery13.ShowText = false;
this.battery13.Size = new System.Drawing.Size(60, 32);
this.battery13.TabIndex = 9;
this.battery13.Text = "battery13";
this.battery13.Value = 70;
//
// battery12
//
this.battery12.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121)))));
this.battery12.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79)))));
this.battery12.FillWarn = System.Drawing.Color.Fuchsia;
this.battery12.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery12.Location = new System.Drawing.Point(135, 3);
this.battery12.Name = "battery12";
this.battery12.ShowText = false;
this.battery12.Size = new System.Drawing.Size(60, 32);
this.battery12.TabIndex = 8;
this.battery12.Text = "battery12";
this.battery12.Value = 50;
//
// battery11
//
this.battery11.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121)))));
this.battery11.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79)))));
this.battery11.FillWarn = System.Drawing.Color.Fuchsia;
this.battery11.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery11.Location = new System.Drawing.Point(69, 3);
this.battery11.Name = "battery11";
this.battery11.ShowText = false;
this.battery11.Size = new System.Drawing.Size(60, 32);
this.battery11.TabIndex = 7;
this.battery11.Text = "battery11";
this.battery11.Value = 30;
//
// battery15
//
this.battery15.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121)))));
this.battery15.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79)))));
this.battery15.FillWarn = System.Drawing.Color.Fuchsia;
this.battery15.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.battery15.Location = new System.Drawing.Point(3, 3);
this.battery15.Name = "battery15";
this.battery15.ShowText = false;
this.battery15.Size = new System.Drawing.Size(60, 32);
this.battery15.TabIndex = 6;
this.battery15.Text = "battery15";
this.battery15.Value = 10;
//
// label5
//
this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(3, 319);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(694, 24);
this.label5.TabIndex = 60;
this.label5.Text = "自定义颜色";
//
// BatteryDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "BatteryDemo";
this.Size = new System.Drawing.Size(700, 481);
this.stackPanel1.ResumeLayout(false);
this.flowPanel.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false);
this.flowPanel3.ResumeLayout(false);
this.flowPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.StackPanel stackPanel1;
private AntdUI.Divider divider1;
private AntdUI.Label label2;
private AntdUI.Label label1;
private AntdUI.FlowPanel flowPanel;
private AntdUI.Label label4;
private AntdUI.Battery battery5;
private AntdUI.Battery battery1;
private AntdUI.Battery battery2;
private AntdUI.Battery battery4;
private AntdUI.Battery battery6;
private AntdUI.FlowPanel flowPanel1;
private AntdUI.Battery battery3;
private AntdUI.Battery battery7;
private AntdUI.Battery battery8;
private AntdUI.Battery battery9;
private AntdUI.Battery battery10;
private AntdUI.Label label3;
private AntdUI.FlowPanel flowPanel2;
private AntdUI.Battery battery14;
private AntdUI.Battery battery13;
private AntdUI.Battery battery12;
private AntdUI.Battery battery11;
private AntdUI.Battery battery15;
private AntdUI.Label label5;
private AntdUI.FlowPanel flowPanel3;
private AntdUI.Battery battery16;
private AntdUI.Battery battery17;
private AntdUI.Battery battery18;
private AntdUI.Battery battery19;
private AntdUI.Battery battery20;
private AntdUI.Label label6;
}
}

20
Views/BatteryDemo.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 BatteryDemo : UserControl
{
public BatteryDemo()
{
InitializeComponent();
}
}
}

120
Views/BatteryDemo.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>

120
Views/ChatListDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,120 @@
namespace AntdUIDemo.Views
{
partial class ChatListDemo
{
/// <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.panel1 = new AntdUI.Panel();
this.chatList = new AntdUI.Chat.ChatList();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.stackPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.panel1);
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, 557);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// panel1
//
this.panel1.Controls.Add(this.chatList);
this.panel1.Location = new System.Drawing.Point(3, 97);
this.panel1.Name = "panel1";
this.panel1.Shadow = 12;
this.panel1.Size = new System.Drawing.Size(694, 457);
this.panel1.TabIndex = 32;
this.panel1.Text = "panel1";
//
// chatList
//
this.chatList.Dock = System.Windows.Forms.DockStyle.Fill;
this.chatList.Location = new System.Drawing.Point(12, 12);
this.chatList.Name = "chatList";
this.chatList.Size = new System.Drawing.Size(670, 433);
this.chatList.TabIndex = 0;
this.chatList.Text = "chatList1";
//
// 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 = 31;
//
// 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 = 30;
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 = 29;
this.label1.Text = "ChatList 气泡聊天列表";
//
// ChatListDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "ChatListDemo";
this.Size = new System.Drawing.Size(700, 557);
this.stackPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.StackPanel stackPanel1;
private AntdUI.Divider divider1;
private AntdUI.Label label2;
private AntdUI.Label label1;
private AntdUI.Panel panel1;
private AntdUI.Chat.ChatList chatList;
}
}

126
Views/ChatListDemo.cs Normal file
View File

@ -0,0 +1,126 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AntdUIDemo.Views
{
public partial class ChatListDemo : UserControl
{
public ChatListDemo()
{
InitializeComponent();
// 绑定事件
BindEventHandler();
}
private void BindEventHandler()
{
this.Load += ChatListDemo_Load;
}
private void ChatListDemo_Load(object sender, EventArgs e)
{
Task.Run(() =>
{
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("阿威十八式 🙌🖖🤘👋", Properties.Resources.head, "AduSkin"));
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("搭配 Nuget Tom.HttpLib 可以轻松实现GPT流式传输\n\nhttps://gitee.com/EVA-SS/HttpLib", Properties.Resources.head, "Tom") { Me = true });
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("估计还是因为长得帅把", Properties.Resources.head, "Tom") { Me = true });
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("城区这车油耗就是高没啥说的suv本来就不省油", Properties.Resources.head, "AduSkin"));
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("咱这车换个轮眉得多少钱啊", Properties.Resources.head, "2.0T 银"));
Thread.Sleep(1000);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("百来块吧", Properties.Resources.head, "Tom") { Me = true });
Thread.Sleep(2000);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("我看一般都前端做的winform还没见过", Properties.Resources.head, "阿枫"));
Thread.Sleep(700);
chatList.AddToBottom(new AntdUI.Chat.TextChatItem("别聊这些\r\n------------------------------", Properties.Resources.head, "2.0T 银"));
Thread.Sleep(1200);
#region GPT
var msg = new AntdUI.Chat.TextChatItem("", Properties.Resources.head, "2.0T 银");
bool isbut = chatList.AddIsBottom(msg);
msg.Loading = true;
Thread.Sleep(1200);
if (isbut) chatList.ToBottom();
var strs = new List<string>() {
"It seems like your question",
" contains phrases that are taken from religious or biblical texts, ",
"particularly from the Book of Genesis in the Bible. ",
"To interpret your question, it appears you are asking ",
"about the initial reign and the significance of ",
"the firmament, dominion, and the first tree in the creation ",
"story.\r\n\r\nIn the Book of Genesis, God is depicted as creating the universe and everything in it. ",
"The firmament",
" refers to the sky or ",
"the space that separates the",
" Earth from ",
"the waters above. On ",
"the second day of creation, according to Genesis 1:6-8, God created the firmament",
" to divide the waters below (the seas) from the waters above.\r\n\r\nThe concept of ",
"dominion comes into play on the sixth day of creation when God created humans,",
" as described in Genesis 1:26-28.",
" God gave humans dominion over the fish,",
" birds, and every living",
" creature",
" on the",
" Earth, as well as over the plants and ",
"trees.\r\n\r\nThe first tree mentioned in the Bible is the Tree of ",
"the Knowledge of Good and Evil, which appears in the Garden of Eden story",
" in Genesis 2:9. God commanded Adam, the first human, not to ",
"eat from this tree, warning that doing so would result in death.",
" The Tree of Life is another significant tree mentioned in the Garden of",
" Eden.\r\n\r\nAs for the phrase \"the seas he i were cattle Under living.",
" It may beast every forth place,\" it is unclear what you are asking.",
" However, if you are referring to the creation of living creatures, Genesis",
" 1:20-23 describes how God created aquatic creatures and birds on",
" the fifth day, and land animals and humans on the sixth day." };
string text = string.Join("", strs);
var ran = new Random();
bool run = true;
int i = 0;
while (run)
{
Thread.Sleep(ran.Next(10, 200));
int len = ran.Next(1, 16);
if (text.Length < i + len)
{
len = text.Length - i;
run = false;
}
if (len > 0)
{
msg.Text += text.Substring(i, len);
if (isbut) chatList.ToBottom();
i += len;
}
}
msg.Loading = false;
#endregion
});
}
}
}

120
Views/ChatListDemo.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>

133
Views/ContextMenuStripDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,133 @@
namespace AntdUIDemo.Views
{
partial class ContextMenuStripDemo
{
/// <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.label4 = new AntdUI.Label();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.flowPanel = new AntdUI.FlowPanel();
this.button_base = new AntdUI.Button();
this.stackPanel1.SuspendLayout();
this.flowPanel.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.flowPanel);
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, 498);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// 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 = 53;
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 = 52;
//
// 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 = 51;
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 = 50;
this.label1.Text = "ContextMenuStrip 快捷菜单";
//
// flowPanel
//
this.flowPanel.Controls.Add(this.button_base);
this.flowPanel.Location = new System.Drawing.Point(3, 127);
this.flowPanel.Name = "flowPanel";
this.flowPanel.Size = new System.Drawing.Size(694, 38);
this.flowPanel.TabIndex = 54;
this.flowPanel.Text = "flowPanel1";
//
// button_base
//
this.button_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_base.Location = new System.Drawing.Point(3, 3);
this.button_base.Name = "button_base";
this.button_base.Size = new System.Drawing.Size(80, 32);
this.button_base.TabIndex = 5;
this.button_base.Text = "Click";
this.button_base.Type = AntdUI.TTypeMini.Primary;
this.button_base.WaveSize = 0;
//
// ContextMenuStripDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "ContextMenuStripDemo";
this.Size = new System.Drawing.Size(700, 498);
this.stackPanel1.ResumeLayout(false);
this.flowPanel.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.FlowPanel flowPanel;
private AntdUI.Button button_base;
}
}

View File

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AntdUIDemo.Views
{
public partial class ContextMenuStripDemo : UserControl
{
private AntdUI.Window window;
public ContextMenuStripDemo(AntdUI.Window _window)
{
window = _window;
InitializeComponent();
BindEventHandler();
}
private void BindEventHandler()
{
button_base.Click += Button_base_Click;
}
private void Button_base_Click(object sender, EventArgs e)
{
string svg_back = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112c-4.1 3.2-4.1 9.4 0 12.6l142 112c5.2 4.1 12.9 0.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z\"></path></svg>",
svg_refresh = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2-29.4-29.4-52.5-63.6-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5c-16.1 38.1-39.2 72.3-68.6 101.7-9.3 9.3-19.1 18-29.3 26L668.2 724c-4.1-5.3-12.5-3.5-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 0.8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z\"></path></svg>",
svg_save = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184z m456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840z\" ></path><path d=\"M512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144z m0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z\"></path></svg>",
svg_print = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8z\"></path><path d=\"M852 332H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180z m304 664H360V568h304v276z m200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z\"></path></svg>",
svg_laptop = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M956.9 845.1L896.4 632V168c0-17.7-14.3-32-32-32h-704c-17.7 0-32 14.3-32 32v464L67.9 845.1C60.4 866 75.8 888 98 888h828.8c22.2 0 37.6-22 30.1-42.9zM200.4 208h624v395h-624V208z m228.3 608l8.1-37h150.3l8.1 37H428.7z m224 0l-19.1-86.7c-0.8-3.7-4.1-6.3-7.8-6.3H398.2c-3.8 0-7 2.6-7.8 6.3L371.3 816H151l42.3-149h638.2l42.3 149H652.7z\"></path></svg>",
svg_qr = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M468 128H160c-17.7 0-32 14.3-32 32v308c0 4.4 3.6 8 8 8h332c4.4 0 8-3.6 8-8V136c0-4.4-3.6-8-8-8z m-56 284H192V192h220v220z\"></path><path d=\"M274 338h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM468 548H136c-4.4 0-8 3.6-8 8v308c0 17.7 14.3 32 32 32h308c4.4 0 8-3.6 8-8V556c0-4.4-3.6-8-8-8z m-56 284H192V612h220v220z\"></path><path d=\"M274 758h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM864 128H556c-4.4 0-8 3.6-8 8v332c0 4.4 3.6 8 8 8h332c4.4 0 8-3.6 8-8V160c0-17.7-14.3-32-32-32z m-32 284H612V192h220v220z\"></path><path d=\"M694 338h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM888 548h-48c-4.4 0-8 3.6-8 8v134h-78V556c0-4.4-3.6-8-8-8H556c-4.4 0-8 3.6-8 8v332c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V644h78v102c0 4.4 3.6 8 8 8h190c4.4 0 8-3.6 8-8V556c0-4.4-3.6-8-8-8z\"></path><path d=\"M746 832h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM888 832h-48c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z\"></path></svg>",
svg_a = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8zM253.7 736h85c4.2 0 8-2.7 9.3-6.8l53.7-166h219.2l53.2 166c1.3 4 5 6.8 9.3 6.8h89.1c1.1 0 2.2-0.2 3.2-0.5 5.1-1.8 7.8-7.3 6-12.4L573.6 118.6c-1.4-3.9-5.1-6.6-9.2-6.6H462.1c-4.2 0-7.9 2.6-9.2 6.6L244.5 723.1c-0.4 1-0.5 2.1-0.5 3.2-0.1 5.3 4.3 9.7 9.7 9.7z m255.9-516.1h4.1l83.8 263.8H424.9l84.7-263.8z\"></path></svg>",
svg_fy = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z\"></path><path d=\"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-0.3 0.8-0.4 1.7-0.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4z m12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80z m160 0h-88v-80h88v80z\"></path></svg>",
svg_add = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H212V212h200v200zM864 144H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16z m-52 268H612V212h200v200zM864 544H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16z m-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z\"></path></svg>",
svg_share = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M752 664c-28.5 0-54.8 10-75.4 26.7L469.4 540.8c1.7-9.3 2.6-19 2.6-28.8s-0.9-19.4-2.6-28.8l207.2-149.9C697.2 350 723.5 360 752 360c66.2 0 120-53.8 120-120s-53.8-120-120-120-120 53.8-120 120c0 11.6 1.6 22.7 4.7 33.3L439.9 415.8C410.7 377.1 364.3 352 312 352c-88.4 0-160 71.6-160 160s71.6 160 160 160c52.3 0 98.7-25.1 127.9-63.8l196.8 142.5c-3.1 10.6-4.7 21.8-4.7 33.3 0 66.2 53.8 120 120 120s120-53.8 120-120-53.8-120-120-120z m0-476c28.7 0 52 23.3 52 52s-23.3 52-52 52-52-23.3-52-52 23.3-52 52-52zM312 600c-48.5 0-88-39.5-88-88s39.5-88 88-88 88 39.5 88 88-39.5 88-88 88z m440 236c-28.7 0-52-23.3-52-52s23.3-52 52-52 52 23.3 52 52-23.3 52-52 52z\"></path></svg>",
svg_about = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M716.3 313.8c19-18.9 19-49.7 0-68.6l-69.9-69.9 0.1 0.1c-18.5-18.5-50.3-50.3-95.3-95.2-21.2-20.7-55.5-20.5-76.5 0.5L80.9 474.2c-21.2 21.1-21.2 55.3 0 76.4L474.6 944c21.2 21.1 55.4 21.1 76.5 0l165.1-165c19-18.9 19-49.7 0-68.6-19-18.9-49.7-18.9-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.2c0.4-0.4 0.9-0.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 0z\"></path><path d=\"M408.6 514.4a106.3 106.2 0 1 0 212.6 0 106.3 106.2 0 1 0-212.6 0Z\"></path><path d=\"M944.8 475.8L821.9 353.5c-19-18.9-49.8-18.9-68.7 0.1-19 18.9-19 49.7 0 68.6l83 82.9c5.2 5.2 5.2 13.3 0 18.5l-81.8 81.7c-19 18.9-19 49.7 0 68.6 19 18.9 49.7 18.9 68.7 0l121.8-121.7c21.1-21.1 21.1-55.2-0.1-76.4z\"></path></svg>";
var menulist = new AntdUI.IContextMenuStripItem[]
{
new AntdUI.ContextMenuStripItem("返回", "Alt+向左键")
{
IconSvg = svg_back
},
new AntdUI.ContextMenuStripItem("刷新", "Ctrl+R")
{
IconSvg = svg_refresh
},
new AntdUI.ContextMenuStripItemDivider(),
new AntdUI.ContextMenuStripItem("另存为", "Ctrl+S")
{
IconSvg = svg_save
},
new AntdUI.ContextMenuStripItem("打印", "Ctrl+P")
{
IconSvg = svg_print
},
new AntdUI.ContextMenuStripItemDivider(),
new AntdUI.ContextMenuStripItem("发送标签页到你的设备")
{
IconSvg = svg_laptop
},
new AntdUI.ContextMenuStripItem("为此页面创建QR代码")
{
IconSvg = svg_qr
},
new AntdUI.ContextMenuStripItem("大声朗读", "Ctrl+Shift+U")
{
IconSvg = svg_a
},
new AntdUI.ContextMenuStripItem("翻译为 中文(简体)")
{
IconSvg = svg_fy
},
new AntdUI.ContextMenuStripItem("将页面添加到集锦")
{
Sub = new AntdUI.IContextMenuStripItem[]
{
new AntdUI.ContextMenuStripItem("返回", "Alt+向左键")
{
IconSvg = svg_back,
Sub = new AntdUI.IContextMenuStripItem[]
{
new AntdUI.ContextMenuStripItem("返回", "Alt+向左键")
{
IconSvg = svg_back
},
new AntdUI.ContextMenuStripItem("刷新", "Ctrl+R")
{
IconSvg = svg_refresh, Checked = true
},
new AntdUI.ContextMenuStripItemDivider(),
new AntdUI.ContextMenuStripItem("另存为", "Ctrl+S")
{
IconSvg = svg_save
},
new AntdUI.ContextMenuStripItem("打印", "Ctrl+P")
{
IconSvg = svg_print
},
},
},
new AntdUI.ContextMenuStripItem("刷新", "Ctrl+R")
{
IconSvg = svg_refresh, Checked = true
},
new AntdUI.ContextMenuStripItemDivider(),
new AntdUI.ContextMenuStripItem("另存为", "Ctrl+S")
{
IconSvg = svg_save
},
new AntdUI.ContextMenuStripItem("打印", "Ctrl+P")
{
IconSvg = svg_print
},
},
IconSvg = svg_add
},
new AntdUI.ContextMenuStripItemDivider(),
new AntdUI.ContextMenuStripItem("共享")
{
IconSvg = svg_share
},
new AntdUI.ContextMenuStripItem("关于")
{
IconSvg = svg_about
},
};
AntdUI.ContextMenuStrip.open(button_base, it =>
{
AntdUI.Message.info(window, it.Text, autoClose: 3);
}, menulist);
}
}
}

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>

106
Views/DividerDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,106 @@
namespace AntdUIDemo.Views
{
partial class DividerDemo
{
/// <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.label4 = new AntdUI.Label();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.stackPanel1.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
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, 518);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// 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 = 57;
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 = 56;
//
// 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 = 55;
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 = 54;
this.label1.Text = "Divider 分割线";
//
// DividerDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "DividerDemo";
this.Size = new System.Drawing.Size(700, 518);
this.stackPanel1.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;
}
}

20
Views/DividerDemo.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 DividerDemo : UserControl
{
public DividerDemo()
{
InitializeComponent();
}
}
}

120
Views/DividerDemo.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>

120
Views/MsgListDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,120 @@
namespace AntdUIDemo.Views
{
partial class MsgListDemo
{
/// <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.panel1 = new AntdUI.Panel();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.msgList = new AntdUI.Chat.MsgList();
this.stackPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.panel1);
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, 471);
this.stackPanel1.TabIndex = 1;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// panel1
//
this.panel1.Controls.Add(this.msgList);
this.panel1.Location = new System.Drawing.Point(3, 97);
this.panel1.Name = "panel1";
this.panel1.Shadow = 12;
this.panel1.Size = new System.Drawing.Size(694, 371);
this.panel1.TabIndex = 32;
this.panel1.Text = "panel1";
//
// 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 = 31;
//
// 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 = 30;
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 = 29;
this.label1.Text = "ChatList 气泡聊天列表";
//
// msgList
//
this.msgList.Dock = System.Windows.Forms.DockStyle.Left;
this.msgList.Location = new System.Drawing.Point(12, 12);
this.msgList.Name = "msgList";
this.msgList.Size = new System.Drawing.Size(220, 347);
this.msgList.TabIndex = 0;
this.msgList.Text = "msgList1";
//
// MsgListDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "MsgListDemo";
this.Size = new System.Drawing.Size(700, 471);
this.stackPanel1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.StackPanel stackPanel1;
private AntdUI.Panel panel1;
private AntdUI.Divider divider1;
private AntdUI.Label label2;
private AntdUI.Label label1;
private AntdUI.Chat.MsgList msgList;
}
}

54
Views/MsgListDemo.cs Normal file
View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AntdUIDemo.Views
{
public partial class MsgListDemo : UserControl
{
public MsgListDemo()
{
InitializeComponent();
// 绑定事件
BindEventHandler();
}
private void BindEventHandler()
{
Task.Factory.StartNew(() =>
{
msgList.Items.Add(new AntdUI.Chat.MsgItem("WPF / Flutter UI", Properties.Resources.head)
{
Select = true,
Text = "AduSkin我初三就上班啦",
Time = DateTime.Now.ToString("HH:mm:ss")
});
Thread.Sleep(1000);
msgList.Items.Add(new AntdUI.Chat.MsgItem("宝宝", Properties.Resources.head)
{
Text = "今天给你买一束花",
Time = DateTime.Now.ToString("HH:mm:ss")
});
Thread.Sleep(1000);
msgList.Items.Add(new AntdUI.Chat.MsgItem("AntdUI", Properties.Resources.head)
{
Text = "Tom❤AntDesign设计语言的Winform界面库",
Time = DateTime.Now.ToString("HH:mm:ss")
});
Thread.Sleep(1000);
msgList.Items.Add(new AntdUI.Chat.MsgItem("AntdUI", Properties.Resources.head)
{
Text = "晚上一起 Crazy Day 4",
Time = "疯狂星期四"
});
});
}
}
}

120
Views/MsgListDemo.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>

View File

@ -29,18 +29,25 @@
private void InitializeComponent()
{
this.stackPanel1 = new AntdUI.StackPanel();
this.flowPanel = new AntdUI.FlowPanel();
this.label4 = new AntdUI.Label();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.label4 = new AntdUI.Label();
this.flowPanel = new AntdUI.FlowPanel();
this.button2 = new AntdUI.Button();
this.flowPanel1 = new AntdUI.FlowPanel();
this.label_spin = new AntdUI.Label();
this.button_control = new AntdUI.Button();
this.button_window = new AntdUI.Button();
this.button_custom = new AntdUI.Button();
this.button_base = new AntdUI.Button();
this.stackPanel1.SuspendLayout();
this.flowPanel.SuspendLayout();
this.flowPanel1.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.flowPanel1);
this.stackPanel1.Controls.Add(this.flowPanel);
this.stackPanel1.Controls.Add(this.label4);
this.stackPanel1.Controls.Add(this.divider1);
@ -54,6 +61,27 @@
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// flowPanel
//
this.flowPanel.Controls.Add(this.button_window);
this.flowPanel.Controls.Add(this.button_custom);
this.flowPanel.Controls.Add(this.button_base);
this.flowPanel.Controls.Add(this.button_control);
this.flowPanel.Location = new System.Drawing.Point(3, 127);
this.flowPanel.Name = "flowPanel";
this.flowPanel.Size = new System.Drawing.Size(694, 38);
this.flowPanel.TabIndex = 50;
this.flowPanel.Text = "flowPanel1";
//
// 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 = 49;
this.label4.Text = "基本用法";
//
// divider1
//
this.divider1.Location = new System.Drawing.Point(3, 79);
@ -79,34 +107,68 @@
this.label1.TabIndex = 46;
this.label1.Text = "Spin 加载中";
//
// label4
// flowPanel1
//
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 = 49;
this.label4.Text = "基本用法";
this.flowPanel1.Controls.Add(this.label_spin);
this.flowPanel1.Location = new System.Drawing.Point(3, 171);
this.flowPanel1.Name = "flowPanel1";
this.flowPanel1.Size = new System.Drawing.Size(694, 38);
this.flowPanel1.TabIndex = 51;
this.flowPanel1.Text = "flowPanel1";
//
// flowPanel
// label_spin
//
this.flowPanel.Controls.Add(this.button2);
this.flowPanel.Location = new System.Drawing.Point(3, 127);
this.flowPanel.Name = "flowPanel";
this.flowPanel.Size = new System.Drawing.Size(694, 38);
this.flowPanel.TabIndex = 50;
this.flowPanel.Text = "flowPanel1";
this.label_spin.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label_spin.Location = new System.Drawing.Point(3, 3);
this.label_spin.Name = "label_spin";
this.label_spin.Size = new System.Drawing.Size(166, 32);
this.label_spin.TabIndex = 1;
this.label_spin.Text = "这是一个Label控件";
this.label_spin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// button2
// button_control
//
this.button2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.Location = new System.Drawing.Point(3, 3);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 32);
this.button2.TabIndex = 2;
this.button2.Text = "Primary";
this.button2.Type = AntdUI.TTypeMini.Primary;
this.button2.WaveSize = 0;
this.button_control.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_control.Location = new System.Drawing.Point(3, 3);
this.button_control.Name = "button_control";
this.button_control.Size = new System.Drawing.Size(80, 32);
this.button_control.TabIndex = 5;
this.button_control.Text = "控件";
this.button_control.Type = AntdUI.TTypeMini.Primary;
this.button_control.WaveSize = 0;
//
// button_window
//
this.button_window.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_window.Location = new System.Drawing.Point(261, 3);
this.button_window.Name = "button_window";
this.button_window.Size = new System.Drawing.Size(80, 32);
this.button_window.TabIndex = 8;
this.button_window.Text = "整个窗口";
this.button_window.Type = AntdUI.TTypeMini.Primary;
this.button_window.WaveSize = 0;
//
// button_custom
//
this.button_custom.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_custom.Location = new System.Drawing.Point(175, 3);
this.button_custom.Name = "button_custom";
this.button_custom.Size = new System.Drawing.Size(80, 32);
this.button_custom.TabIndex = 7;
this.button_custom.Text = "当前窗口";
this.button_custom.Type = AntdUI.TTypeMini.Primary;
this.button_custom.WaveSize = 0;
//
// button_base
//
this.button_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_base.Location = new System.Drawing.Point(89, 3);
this.button_base.Name = "button_base";
this.button_base.Size = new System.Drawing.Size(80, 32);
this.button_base.TabIndex = 6;
this.button_base.Text = "容器";
this.button_base.Type = AntdUI.TTypeMini.Primary;
this.button_base.WaveSize = 0;
//
// SpinDemo
//
@ -116,6 +178,7 @@
this.Size = new System.Drawing.Size(700, 469);
this.stackPanel1.ResumeLayout(false);
this.flowPanel.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -128,6 +191,11 @@
private AntdUI.Label label1;
private AntdUI.Label label4;
private AntdUI.FlowPanel flowPanel;
private AntdUI.Button button2;
private AntdUI.FlowPanel flowPanel1;
private AntdUI.Label label_spin;
private AntdUI.Button button_control;
private AntdUI.Button button_window;
private AntdUI.Button button_custom;
private AntdUI.Button button_base;
}
}

View File

@ -1,10 +1,12 @@
using System;
using AntdUI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -12,9 +14,79 @@ namespace AntdUIDemo.Views
{
public partial class SpinDemo : UserControl
{
public SpinDemo()
private AntdUI.Window window;
public SpinDemo(AntdUI.Window _window)
{
window = _window;
InitializeComponent();
// 绑定事件
BindEventHandler();
}
private void BindEventHandler()
{
button_control.Click += Button_control_Click;
button_base.Click += Button_base_Click;
button_custom.Click += Button_custom_Click;
button_window.Click += Button_window_Click;
}
private void Button_control_Click(object sender, EventArgs e)
{
AntdUI.Spin.open(label_spin, new AntdUI.Spin.Config()
{
Back = Color.FromArgb(220, 147, 181, 207),
Color = Color.White,
Radius = 6,
}, () =>
{
//耗时代码,加载数据
Thread.Sleep(1000);
});
}
private void Button_window_Click(object sender, EventArgs e)
{
AntdUI.Spin.open(window, new AntdUI.Spin.Config()
{
Back = Color.FromArgb(220,147, 181, 207),
Color = Color.White,
Radius = 6,
}, () =>
{
//耗时代码,加载数据
Thread.Sleep(1000);
});
}
private void Button_custom_Click(object sender, EventArgs e)
{
AntdUI.Spin.open(this, new AntdUI.Spin.Config()
{
Back = Color.FromArgb(220, 147, 181, 207),
Color = Color.White,
Radius = 6,
}, () =>
{
//耗时代码,加载数据
Thread.Sleep(1000);
});
}
private void Button_base_Click(object sender, EventArgs e)
{
//匿名委托
AntdUI.Spin.open(flowPanel1, new AntdUI.Spin.Config()
{
Back = Color.FromArgb(220, 147, 181, 207),
Color = Color.White,
Radius = 6,
}, () =>
{
//耗时代码,加载数据
Thread.Sleep(1000);
});
}
}
}