升级1.7.4,新增LabelTime,Colorpicker支持清除按钮,Collapse支持点击事件,FloatButton支持禁用和加载,Table添加树形表格示例,TimePicker支持时分秒水平对齐

This commit is contained in:
czz_y 2024-11-17 11:58:37 +08:00
parent a9f549a289
commit 13fbece44e
16 changed files with 630 additions and 89 deletions

View File

@ -13,7 +13,7 @@
<Copyright>Copyright © 2024 czz_y</Copyright> <Copyright>Copyright © 2024 czz_y</Copyright>
<FileVersion>$(Version)</FileVersion> <FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion> <AssemblyVersion>$(Version)</AssemblyVersion>
<Version>1.7.1</Version> <Version>1.7.4</Version>
<Authors>czz_y</Authors> <Authors>czz_y</Authors>
<Description>基于 Winform UI 框架 AntdUI 设计的 Demo</Description> <Description>基于 Winform UI 框架 AntdUI 设计的 Demo</Description>
<PackageProjectUrl>https://gitee.com/mubaiyanghua/antd-uidemo</PackageProjectUrl> <PackageProjectUrl>https://gitee.com/mubaiyanghua/antd-uidemo</PackageProjectUrl>
@ -30,7 +30,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AntdUI" Version="1.7.1" /> <PackageReference Include="AntdUI" Version="1.7.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.3" /> <PackageReference Include="NLog" Version="5.3.3" />
</ItemGroup> </ItemGroup>

View File

@ -275,11 +275,14 @@ namespace AntdUIDemo
control = new CarouselDemo(); control = new CarouselDemo();
break; break;
case "Collapse": case "Collapse":
control = new CollapseDemo(); control = new CollapseDemo(this);
break; break;
case "Label": case "Label":
control = new LabelDemo(); control = new LabelDemo();
break; break;
case "LabelTime":
control = new LabelTimeDemo();
break;
case "Popover": case "Popover":
control = new PopoverDemo(this); control = new PopoverDemo(this);
break; break;

View File

@ -59,6 +59,7 @@ namespace AntdUIDemo.Models
new MenuItems { Text = "Carousel 走马灯", Tag = "Carousel"}, new MenuItems { Text = "Carousel 走马灯", Tag = "Carousel"},
new MenuItems { Text = "Collapse 折叠面板", Tag = "Collapse"}, new MenuItems { Text = "Collapse 折叠面板", Tag = "Collapse"},
new MenuItems { Text = "Label 标签", Tag = "Label"}, new MenuItems { Text = "Label 标签", Tag = "Label"},
new MenuItems { Text = "LabelTime 时间标签", Tag = "LabelTime"},
new MenuItems { Text = "Popover 气泡卡片", Tag = "Popover"}, new MenuItems { Text = "Popover 气泡卡片", Tag = "Popover"},
new MenuItems { Text = "Preview 图片预览", Tag = "Preview"}, new MenuItems { Text = "Preview 图片预览", Tag = "Preview"},
new MenuItems { Text = "Segmented 分段控制器", Tag = "Segmented"}, new MenuItems { Text = "Segmented 分段控制器", Tag = "Segmented"},

View File

@ -16,6 +16,8 @@ namespace AntdUIDemo.Models
private CellLink[] cellLinks; private CellLink[] cellLinks;
private CellProgress cellProgress; private CellProgress cellProgress;
private CellDivider cellDivider; private CellDivider cellDivider;
//用于设置树形表格,加入自身数组
private User[] users;
public bool Selected public bool Selected
{ {
@ -149,5 +151,16 @@ namespace AntdUIDemo.Models
} }
} }
public User[] Users
{
get { return users; }
set
{
if (users == value) return;
users = value;
OnPropertyChanged(nameof(Users));
}
}
} }
} }

View File

@ -4,7 +4,7 @@
<h1>AntdUI Demo</h1> <h1>AntdUI Demo</h1>
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.7.1` 本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.7.4`
</div> </div>

View File

@ -1,12 +1,28 @@
using System.Windows.Forms; using System;
using System.Windows.Forms;
namespace AntdUIDemo.Views namespace AntdUIDemo.Views
{ {
public partial class CollapseDemo : UserControl public partial class CollapseDemo : UserControl
{ {
public CollapseDemo() private AntdUI.Window window;
public CollapseDemo(AntdUI.Window _window)
{ {
window = _window;
InitializeComponent(); InitializeComponent();
BindEventHandler();
}
private void BindEventHandler()
{
collapse1.ExpandChanged += Collapse_ExpandChanged;
}
private void Collapse_ExpandChanged(object sender, AntdUI.CollapseExpandEventArgs e)
{
//关闭和打开都会触发
string str = e.Expand ? "open" : "close";
AntdUI.Notification.info(window, str, e.Value.ToString(),autoClose:3);
} }
} }
} }

View File

@ -54,11 +54,16 @@
this.colorPicker2 = new AntdUI.ColorPicker(); this.colorPicker2 = new AntdUI.ColorPicker();
this.colorPicker1 = new AntdUI.ColorPicker(); this.colorPicker1 = new AntdUI.ColorPicker();
this.label3 = new AntdUI.Label(); this.label3 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.flowPanel5 = new AntdUI.FlowPanel();
this.colorPicker20 = new AntdUI.ColorPicker();
this.colorPicker17 = new AntdUI.ColorPicker();
this.stackPanel1.SuspendLayout(); this.stackPanel1.SuspendLayout();
this.flowPanel4.SuspendLayout(); this.flowPanel4.SuspendLayout();
this.flowPanel3.SuspendLayout(); this.flowPanel3.SuspendLayout();
this.flowPanel2.SuspendLayout(); this.flowPanel2.SuspendLayout();
this.flowPanel1.SuspendLayout(); this.flowPanel1.SuspendLayout();
this.flowPanel5.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// header1 // header1
@ -77,6 +82,8 @@
// //
// stackPanel1 // stackPanel1
// //
this.stackPanel1.Controls.Add(this.flowPanel5);
this.stackPanel1.Controls.Add(this.label1);
this.stackPanel1.Controls.Add(this.flowPanel4); this.stackPanel1.Controls.Add(this.flowPanel4);
this.stackPanel1.Controls.Add(this.label6); this.stackPanel1.Controls.Add(this.label6);
this.stackPanel1.Controls.Add(this.flowPanel3); this.stackPanel1.Controls.Add(this.flowPanel3);
@ -88,7 +95,7 @@
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stackPanel1.Location = new System.Drawing.Point(0, 74); this.stackPanel1.Location = new System.Drawing.Point(0, 74);
this.stackPanel1.Name = "stackPanel1"; this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Size = new System.Drawing.Size(750, 361); this.stackPanel1.Size = new System.Drawing.Size(750, 421);
this.stackPanel1.TabIndex = 0; this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1"; this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true; this.stackPanel1.Vertical = true;
@ -381,18 +388,61 @@
this.label3.TabIndex = 8; this.label3.TabIndex = 8;
this.label3.Text = "文字显示"; this.label3.Text = "文字显示";
// //
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 299);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(744, 24);
this.label1.TabIndex = 16;
this.label1.Text = "清除选择";
//
// flowPanel5
//
this.flowPanel5.Controls.Add(this.colorPicker17);
this.flowPanel5.Controls.Add(this.colorPicker20);
this.flowPanel5.Location = new System.Drawing.Point(3, 329);
this.flowPanel5.Name = "flowPanel5";
this.flowPanel5.Size = new System.Drawing.Size(744, 38);
this.flowPanel5.TabIndex = 17;
this.flowPanel5.Text = "flowPanel5";
//
// colorPicker20
//
this.colorPicker20.AllowClear = true;
this.colorPicker20.Location = new System.Drawing.Point(3, 3);
this.colorPicker20.Name = "colorPicker20";
this.colorPicker20.Size = new System.Drawing.Size(32, 32);
this.colorPicker20.TabIndex = 0;
this.colorPicker20.Text = "colorPicker20";
this.colorPicker20.Value = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(119)))), ((int)(((byte)(255)))));
this.colorPicker20.WaveSize = 0;
//
// colorPicker17
//
this.colorPicker17.AllowClear = true;
this.colorPicker17.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.colorPicker17.Location = new System.Drawing.Point(41, 3);
this.colorPicker17.Name = "colorPicker17";
this.colorPicker17.ShowText = true;
this.colorPicker17.Size = new System.Drawing.Size(105, 32);
this.colorPicker17.TabIndex = 4;
this.colorPicker17.Text = "colorPicker17";
this.colorPicker17.Value = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(119)))), ((int)(((byte)(255)))));
this.colorPicker17.WaveSize = 0;
//
// ColorPickerDemo // ColorPickerDemo
// //
this.Controls.Add(this.stackPanel1); this.Controls.Add(this.stackPanel1);
this.Controls.Add(this.header1); this.Controls.Add(this.header1);
this.Name = "ColorPickerDemo"; this.Name = "ColorPickerDemo";
this.Size = new System.Drawing.Size(750, 435); this.Size = new System.Drawing.Size(750, 495);
this.stackPanel1.ResumeLayout(false); this.stackPanel1.ResumeLayout(false);
this.flowPanel4.ResumeLayout(false); this.flowPanel4.ResumeLayout(false);
this.flowPanel3.ResumeLayout(false); this.flowPanel3.ResumeLayout(false);
this.flowPanel2.ResumeLayout(false); this.flowPanel2.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false); this.flowPanel1.ResumeLayout(false);
this.flowPanel5.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -425,5 +475,9 @@
private AntdUI.ColorPicker colorPicker16; private AntdUI.ColorPicker colorPicker16;
private AntdUI.ColorPicker colorPicker14; private AntdUI.ColorPicker colorPicker14;
private AntdUI.ColorPicker colorPicker12; private AntdUI.ColorPicker colorPicker12;
private AntdUI.FlowPanel flowPanel5;
private AntdUI.ColorPicker colorPicker20;
private AntdUI.Label label1;
private AntdUI.ColorPicker colorPicker17;
} }
} }

View File

@ -30,12 +30,7 @@
{ {
this.header1 = new AntdUI.PageHeader(); this.header1 = new AntdUI.PageHeader();
this.stackPanel1 = new AntdUI.StackPanel(); this.stackPanel1 = new AntdUI.StackPanel();
this.stackPanel2 = new AntdUI.StackPanel();
this.buttonCZ = new AntdUI.Button();
this.buttonClose = new AntdUI.Button();
this.stackPanel6 = new AntdUI.StackPanel(); this.stackPanel6 = new AntdUI.StackPanel();
this.colorPicker = new AntdUI.ColorPicker();
this.label16 = new AntdUI.Label();
this.input_badgesize = new AntdUI.InputNumber(); this.input_badgesize = new AntdUI.InputNumber();
this.label15 = new AntdUI.Label(); this.label15 = new AntdUI.Label();
this.input_badge = new AntdUI.Input(); this.input_badge = new AntdUI.Input();
@ -67,13 +62,24 @@
this.label10 = new AntdUI.Label(); this.label10 = new AntdUI.Label();
this.label4 = new AntdUI.Label(); this.label4 = new AntdUI.Label();
this.label3 = new AntdUI.Label(); this.label3 = new AntdUI.Label();
this.stackPanel8 = new AntdUI.StackPanel();
this.stackPanel2 = new AntdUI.StackPanel();
this.buttonCZ = new AntdUI.Button();
this.buttonClose = new AntdUI.Button();
this.colorPicker = new AntdUI.ColorPicker();
this.label16 = new AntdUI.Label();
this.switch_loading = new AntdUI.Switch();
this.label2 = new AntdUI.Label();
this.switch_enabled = new AntdUI.Switch();
this.label18 = new AntdUI.Label();
this.stackPanel1.SuspendLayout(); this.stackPanel1.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.stackPanel6.SuspendLayout(); this.stackPanel6.SuspendLayout();
this.stackPanel5.SuspendLayout(); this.stackPanel5.SuspendLayout();
this.stackPanel7.SuspendLayout(); this.stackPanel7.SuspendLayout();
this.stackPanel4.SuspendLayout(); this.stackPanel4.SuspendLayout();
this.stackPanel3.SuspendLayout(); this.stackPanel3.SuspendLayout();
this.stackPanel8.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// header1 // header1
@ -93,6 +99,7 @@
// stackPanel1 // stackPanel1
// //
this.stackPanel1.Controls.Add(this.stackPanel2); this.stackPanel1.Controls.Add(this.stackPanel2);
this.stackPanel1.Controls.Add(this.stackPanel8);
this.stackPanel1.Controls.Add(this.stackPanel6); this.stackPanel1.Controls.Add(this.stackPanel6);
this.stackPanel1.Controls.Add(this.stackPanel5); this.stackPanel1.Controls.Add(this.stackPanel5);
this.stackPanel1.Controls.Add(this.label11); this.stackPanel1.Controls.Add(this.label11);
@ -103,47 +110,15 @@
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stackPanel1.Location = new System.Drawing.Point(0, 104); this.stackPanel1.Location = new System.Drawing.Point(0, 104);
this.stackPanel1.Name = "stackPanel1"; this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Size = new System.Drawing.Size(750, 330); this.stackPanel1.Size = new System.Drawing.Size(750, 388);
this.stackPanel1.TabIndex = 0; this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1"; this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true; this.stackPanel1.Vertical = true;
// //
// stackPanel2
//
this.stackPanel2.Controls.Add(this.buttonCZ);
this.stackPanel2.Controls.Add(this.buttonClose);
this.stackPanel2.Location = new System.Drawing.Point(3, 253);
this.stackPanel2.Name = "stackPanel2";
this.stackPanel2.Size = new System.Drawing.Size(744, 38);
this.stackPanel2.TabIndex = 26;
this.stackPanel2.Text = "stackPanel2";
//
// buttonCZ
//
this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonCZ.Location = new System.Drawing.Point(84, 3);
this.buttonCZ.Name = "buttonCZ";
this.buttonCZ.Size = new System.Drawing.Size(75, 32);
this.buttonCZ.TabIndex = 4;
this.buttonCZ.Text = "重 置";
this.buttonCZ.Type = AntdUI.TTypeMini.Warn;
this.buttonCZ.WaveSize = 0;
//
// buttonClose
//
this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonClose.Location = new System.Drawing.Point(3, 3);
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(75, 32);
this.buttonClose.TabIndex = 3;
this.buttonClose.Text = "关 闭";
this.buttonClose.Type = AntdUI.TTypeMini.Error;
this.buttonClose.WaveSize = 0;
//
// stackPanel6 // stackPanel6
// //
this.stackPanel6.Controls.Add(this.colorPicker); this.stackPanel6.Controls.Add(this.switch_loading);
this.stackPanel6.Controls.Add(this.label16); this.stackPanel6.Controls.Add(this.label2);
this.stackPanel6.Controls.Add(this.input_badgesize); this.stackPanel6.Controls.Add(this.input_badgesize);
this.stackPanel6.Controls.Add(this.label15); this.stackPanel6.Controls.Add(this.label15);
this.stackPanel6.Controls.Add(this.input_badge); this.stackPanel6.Controls.Add(this.input_badge);
@ -155,27 +130,6 @@
this.stackPanel6.TabIndex = 25; this.stackPanel6.TabIndex = 25;
this.stackPanel6.Text = "stackPanel6"; this.stackPanel6.Text = "stackPanel6";
// //
// colorPicker
//
this.colorPicker.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.colorPicker.Location = new System.Drawing.Point(492, 3);
this.colorPicker.Name = "colorPicker";
this.colorPicker.ShowText = true;
this.colorPicker.Size = new System.Drawing.Size(100, 26);
this.colorPicker.TabIndex = 15;
this.colorPicker.Text = "colorPicker1";
this.colorPicker.Value = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(119)))), ((int)(((byte)(255)))));
this.colorPicker.WaveSize = 0;
//
// label16
//
this.label16.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.Location = new System.Drawing.Point(390, 3);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(92, 26);
this.label16.TabIndex = 14;
this.label16.Text = "BadgeBack";
//
// input_badgesize // input_badgesize
// //
this.input_badgesize.DecimalPlaces = 2; this.input_badgesize.DecimalPlaces = 2;
@ -548,21 +502,124 @@
this.label3.TabIndex = 4; this.label3.TabIndex = 4;
this.label3.Text = "FloatButton没有工具箱控件使用代码方式调用。"; this.label3.Text = "FloatButton没有工具箱控件使用代码方式调用。";
// //
// stackPanel8
//
this.stackPanel8.Controls.Add(this.switch_enabled);
this.stackPanel8.Controls.Add(this.label18);
this.stackPanel8.Controls.Add(this.colorPicker);
this.stackPanel8.Controls.Add(this.label16);
this.stackPanel8.Gap = 4;
this.stackPanel8.Location = new System.Drawing.Point(3, 253);
this.stackPanel8.Name = "stackPanel8";
this.stackPanel8.Size = new System.Drawing.Size(744, 32);
this.stackPanel8.TabIndex = 27;
this.stackPanel8.Text = "stackPanel8";
//
// stackPanel2
//
this.stackPanel2.Controls.Add(this.buttonCZ);
this.stackPanel2.Controls.Add(this.buttonClose);
this.stackPanel2.Location = new System.Drawing.Point(3, 291);
this.stackPanel2.Name = "stackPanel2";
this.stackPanel2.Size = new System.Drawing.Size(744, 38);
this.stackPanel2.TabIndex = 28;
this.stackPanel2.Text = "stackPanel2";
//
// buttonCZ
//
this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonCZ.Location = new System.Drawing.Point(84, 3);
this.buttonCZ.Name = "buttonCZ";
this.buttonCZ.Size = new System.Drawing.Size(75, 32);
this.buttonCZ.TabIndex = 4;
this.buttonCZ.Text = "重 置";
this.buttonCZ.Type = AntdUI.TTypeMini.Warn;
this.buttonCZ.WaveSize = 0;
//
// buttonClose
//
this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonClose.Location = new System.Drawing.Point(3, 3);
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(75, 32);
this.buttonClose.TabIndex = 3;
this.buttonClose.Text = "关 闭";
this.buttonClose.Type = AntdUI.TTypeMini.Error;
this.buttonClose.WaveSize = 0;
//
// colorPicker
//
this.colorPicker.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.colorPicker.Location = new System.Drawing.Point(105, 3);
this.colorPicker.Name = "colorPicker";
this.colorPicker.ShowText = true;
this.colorPicker.Size = new System.Drawing.Size(75, 26);
this.colorPicker.TabIndex = 30;
this.colorPicker.Text = "colorPicker1";
this.colorPicker.Value = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(119)))), ((int)(((byte)(255)))));
this.colorPicker.WaveSize = 0;
//
// label16
//
this.label16.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.Location = new System.Drawing.Point(3, 3);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(92, 26);
this.label16.TabIndex = 29;
this.label16.Text = "BadgeBack";
//
// switch_loading
//
this.switch_loading.AutoCheck = true;
this.switch_loading.Location = new System.Drawing.Point(492, 3);
this.switch_loading.Name = "switch_loading";
this.switch_loading.Size = new System.Drawing.Size(50, 26);
this.switch_loading.TabIndex = 30;
this.switch_loading.Text = "switch1";
//
// 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(390, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 26);
this.label2.TabIndex = 29;
this.label2.Text = "Loading";
//
// switch_enabled
//
this.switch_enabled.AutoCheck = true;
this.switch_enabled.Location = new System.Drawing.Point(292, 3);
this.switch_enabled.Name = "switch_enabled";
this.switch_enabled.Size = new System.Drawing.Size(50, 26);
this.switch_enabled.TabIndex = 32;
this.switch_enabled.Text = "switch1";
//
// label18
//
this.label18.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label18.Location = new System.Drawing.Point(190, 3);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(92, 26);
this.label18.TabIndex = 31;
this.label18.Text = "Enabled";
//
// FloatButtonDemo // FloatButtonDemo
// //
this.Controls.Add(this.stackPanel1); this.Controls.Add(this.stackPanel1);
this.Controls.Add(this.label3); this.Controls.Add(this.label3);
this.Controls.Add(this.header1); this.Controls.Add(this.header1);
this.Name = "FloatButtonDemo"; this.Name = "FloatButtonDemo";
this.Size = new System.Drawing.Size(750, 434); this.Size = new System.Drawing.Size(750, 492);
this.Load += new System.EventHandler(this.FloatButtonDemo_Load); this.Load += new System.EventHandler(this.FloatButtonDemo_Load);
this.stackPanel1.ResumeLayout(false); this.stackPanel1.ResumeLayout(false);
this.stackPanel2.ResumeLayout(false);
this.stackPanel6.ResumeLayout(false); this.stackPanel6.ResumeLayout(false);
this.stackPanel5.ResumeLayout(false); this.stackPanel5.ResumeLayout(false);
this.stackPanel7.ResumeLayout(false); this.stackPanel7.ResumeLayout(false);
this.stackPanel4.ResumeLayout(false); this.stackPanel4.ResumeLayout(false);
this.stackPanel3.ResumeLayout(false); this.stackPanel3.ResumeLayout(false);
this.stackPanel8.ResumeLayout(false);
this.stackPanel2.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -581,12 +638,7 @@
private AntdUI.Select select_align; private AntdUI.Select select_align;
private AntdUI.Label label10; private AntdUI.Label label10;
private AntdUI.Label label4; private AntdUI.Label label4;
private AntdUI.StackPanel stackPanel2;
private AntdUI.Button buttonCZ;
private AntdUI.Button buttonClose;
private AntdUI.StackPanel stackPanel6; private AntdUI.StackPanel stackPanel6;
private AntdUI.ColorPicker colorPicker;
private AntdUI.Label label16;
private AntdUI.InputNumber input_badgesize; private AntdUI.InputNumber input_badgesize;
private AntdUI.Label label15; private AntdUI.Label label15;
private AntdUI.Input input_badge; private AntdUI.Input input_badge;
@ -608,5 +660,15 @@
private AntdUI.Label label14; private AntdUI.Label label14;
private AntdUI.Select select_type; private AntdUI.Select select_type;
private AntdUI.Label label13; private AntdUI.Label label13;
private AntdUI.StackPanel stackPanel2;
private AntdUI.Button buttonCZ;
private AntdUI.Button buttonClose;
private AntdUI.StackPanel stackPanel8;
private AntdUI.Switch switch_enabled;
private AntdUI.Label label18;
private AntdUI.ColorPicker colorPicker;
private AntdUI.Label label16;
private AntdUI.Switch switch_loading;
private AntdUI.Label label2;
} }
} }

View File

@ -77,6 +77,8 @@ namespace AntdUIDemo.Views
switch_round.Checked = false; switch_round.Checked = false;
switch_vertical.Checked = true; switch_vertical.Checked = true;
switch_topmost.Checked = false; switch_topmost.Checked = false;
switch_enabled.Checked = false;
switch_loading.Checked = false;
input_size.Value = 40; input_size.Value = 40;
input_mx.Value = 24; input_mx.Value = 24;
@ -109,6 +111,8 @@ namespace AntdUIDemo.Views
Badge = input_badge.Text, Badge = input_badge.Text,
BadgeSize = (float)input_badgesize.Value, BadgeSize = (float)input_badgesize.Value,
BadgeBack = colorPicker.Value, BadgeBack = colorPicker.Value,
Enabled = switch_enabled.Checked,
}, },
// 使用资源图片 // 使用资源图片
new FloatButton.ConfigBtn("button2", Properties.Resources.) new FloatButton.ConfigBtn("button2", Properties.Resources.)
@ -121,6 +125,8 @@ namespace AntdUIDemo.Views
Badge = input_badge.Text, Badge = input_badge.Text,
BadgeSize = (float)input_badgesize.Value, BadgeSize = (float)input_badgesize.Value,
BadgeBack = colorPicker.Value, BadgeBack = colorPicker.Value,
Enabled = switch_enabled.Checked,
Loading = switch_loading.Checked,
}, },
// 使用文本 // 使用文本
new FloatButton.ConfigBtn("button3", "文本") new FloatButton.ConfigBtn("button3", "文本")
@ -132,6 +138,8 @@ namespace AntdUIDemo.Views
Badge = input_badge.Text, Badge = input_badge.Text,
BadgeSize = (float)input_badgesize.Value, BadgeSize = (float)input_badgesize.Value,
BadgeBack = colorPicker.Value, BadgeBack = colorPicker.Value,
Enabled = switch_enabled.Checked,
Loading = switch_loading.Checked,
}, },
//获取button示例可以通过button的属性判断点击了哪个按钮推荐用Name //获取button示例可以通过button的属性判断点击了哪个按钮推荐用Name
}, button => }, button =>

View File

@ -40,13 +40,19 @@
this.label4 = new AntdUI.Label(); this.label4 = new AntdUI.Label();
this.label3 = new AntdUI.Label(); this.label3 = new AntdUI.Label();
this.header1 = new AntdUI.PageHeader(); this.header1 = new AntdUI.PageHeader();
this.label1 = new AntdUI.Label();
this.flowPanel3 = new AntdUI.FlowPanel();
this.label8 = new AntdUI.Label();
this.stackPanel1.SuspendLayout(); this.stackPanel1.SuspendLayout();
this.flowPanel2.SuspendLayout(); this.flowPanel2.SuspendLayout();
this.flowPanel1.SuspendLayout(); this.flowPanel1.SuspendLayout();
this.flowPanel3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// stackPanel1 // stackPanel1
// //
this.stackPanel1.Controls.Add(this.flowPanel3);
this.stackPanel1.Controls.Add(this.label1);
this.stackPanel1.Controls.Add(this.flowPanel2); this.stackPanel1.Controls.Add(this.flowPanel2);
this.stackPanel1.Controls.Add(this.label9); this.stackPanel1.Controls.Add(this.label9);
this.stackPanel1.Controls.Add(this.flowPanel1); this.stackPanel1.Controls.Add(this.flowPanel1);
@ -178,6 +184,36 @@
this.header1.Text = "Label 标签"; this.header1.Text = "Label 标签";
this.header1.UseTitleFont = true; this.header1.UseTitleFont = true;
// //
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 151);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(744, 24);
this.label1.TabIndex = 33;
this.label1.Text = "文字渐变";
//
// flowPanel3
//
this.flowPanel3.Controls.Add(this.label8);
this.flowPanel3.Gap = 6;
this.flowPanel3.Location = new System.Drawing.Point(3, 181);
this.flowPanel3.Name = "flowPanel3";
this.flowPanel3.Size = new System.Drawing.Size(744, 38);
this.flowPanel3.TabIndex = 34;
this.flowPanel3.Text = "flowPanel3";
//
// label8
//
this.label8.ColorExtend = "135,#FF0000,#00FF00";
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, 3);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(120, 32);
this.label8.TabIndex = 0;
this.label8.Text = "渐变标签";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// LabelDemo // LabelDemo
// //
this.Controls.Add(this.stackPanel1); this.Controls.Add(this.stackPanel1);
@ -187,6 +223,7 @@
this.stackPanel1.ResumeLayout(false); this.stackPanel1.ResumeLayout(false);
this.flowPanel2.ResumeLayout(false); this.flowPanel2.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false); this.flowPanel1.ResumeLayout(false);
this.flowPanel3.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -204,5 +241,8 @@
private AntdUI.Label label10; private AntdUI.Label label10;
private AntdUI.Label label11; private AntdUI.Label label11;
private AntdUI.PageHeader header1; private AntdUI.PageHeader header1;
private AntdUI.FlowPanel flowPanel3;
private AntdUI.Label label8;
private AntdUI.Label label1;
} }
} }

128
Views/LabelTimeDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,128 @@
namespace AntdUIDemo.Views
{
partial class LabelTimeDemo
{
/// <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.header1 = new AntdUI.PageHeader();
this.stackPanel1 = new AntdUI.StackPanel();
this.flowPanel2 = new AntdUI.FlowPanel();
this.labelTime1 = new AntdUI.LabelTime();
this.labelTime2 = new AntdUI.LabelTime();
this.label3 = new AntdUI.Label();
this.stackPanel1.SuspendLayout();
this.flowPanel2.SuspendLayout();
this.SuspendLayout();
//
// header1
//
this.header1.Description = "显示实时日期时间的文本。";
this.header1.DividerShow = true;
this.header1.Dock = System.Windows.Forms.DockStyle.Top;
this.header1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.header1.Location = new System.Drawing.Point(0, 0);
this.header1.Name = "header1";
this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
this.header1.Size = new System.Drawing.Size(750, 74);
this.header1.TabIndex = 28;
this.header1.Text = "LabelTime 时间标签";
this.header1.UseTitleFont = true;
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.flowPanel2);
this.stackPanel1.Controls.Add(this.label3);
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stackPanel1.Location = new System.Drawing.Point(0, 74);
this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Size = new System.Drawing.Size(750, 393);
this.stackPanel1.TabIndex = 29;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// flowPanel2
//
this.flowPanel2.Controls.Add(this.labelTime1);
this.flowPanel2.Controls.Add(this.labelTime2);
this.flowPanel2.Location = new System.Drawing.Point(3, 33);
this.flowPanel2.Name = "flowPanel2";
this.flowPanel2.Size = new System.Drawing.Size(744, 76);
this.flowPanel2.TabIndex = 41;
this.flowPanel2.Text = "flowPanel2";
//
// labelTime1
//
this.labelTime1.BadgeSize = 1F;
this.labelTime1.BadgeSvg = "FieldTimeOutlined";
this.labelTime1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
this.labelTime1.Location = new System.Drawing.Point(309, 3);
this.labelTime1.Name = "labelTime1";
this.labelTime1.ShowTime = false;
this.labelTime1.Size = new System.Drawing.Size(300, 70);
this.labelTime1.TabIndex = 2;
this.labelTime1.Text = "labelTime1";
//
// labelTime2
//
this.labelTime2.Location = new System.Drawing.Point(3, 3);
this.labelTime2.Name = "labelTime2";
this.labelTime2.Size = new System.Drawing.Size(300, 70);
this.labelTime2.TabIndex = 1;
this.labelTime2.Text = "labelTime2";
//
// 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, 3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(744, 24);
this.label3.TabIndex = 26;
this.label3.Text = "基本用法";
//
// LabelTimeDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Controls.Add(this.header1);
this.Name = "LabelTimeDemo";
this.Size = new System.Drawing.Size(750, 467);
this.stackPanel1.ResumeLayout(false);
this.flowPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.PageHeader header1;
private AntdUI.StackPanel stackPanel1;
private AntdUI.Label label3;
private AntdUI.FlowPanel flowPanel2;
private AntdUI.LabelTime labelTime1;
private AntdUI.LabelTime labelTime2;
}
}

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

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

@ -72,20 +72,20 @@
this.stackPanel1.Name = "stackPanel1"; this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Padding = new System.Windows.Forms.Padding(3); this.stackPanel1.Padding = new System.Windows.Forms.Padding(3);
this.stackPanel1.Radius = 0; this.stackPanel1.Radius = 0;
this.stackPanel1.Size = new System.Drawing.Size(750, 486); this.stackPanel1.Size = new System.Drawing.Size(750, 526);
this.stackPanel1.TabIndex = 0; this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1"; this.stackPanel1.Text = "stackPanel1";
// //
// table_base // table_base
// //
this.table_base.Dock = System.Windows.Forms.DockStyle.Fill; this.table_base.Dock = System.Windows.Forms.DockStyle.Top;
this.table_base.EmptyHeader = true; this.table_base.EmptyHeader = true;
this.table_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.table_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.table_base.Gap = 8; this.table_base.Gap = 8;
this.table_base.Location = new System.Drawing.Point(3, 103); this.table_base.Location = new System.Drawing.Point(3, 103);
this.table_base.Name = "table_base"; this.table_base.Name = "table_base";
this.table_base.ShowTip = false; this.table_base.ShowTip = false;
this.table_base.Size = new System.Drawing.Size(744, 380); this.table_base.Size = new System.Drawing.Size(744, 417);
this.table_base.TabIndex = 30; this.table_base.TabIndex = 30;
this.table_base.Text = "table1"; this.table_base.Text = "table1";
// //
@ -226,7 +226,7 @@
this.Controls.Add(this.stackPanel1); this.Controls.Add(this.stackPanel1);
this.Controls.Add(this.header1); this.Controls.Add(this.header1);
this.Name = "TableDemo"; this.Name = "TableDemo";
this.Size = new System.Drawing.Size(750, 560); this.Size = new System.Drawing.Size(750, 600);
this.stackPanel1.ResumeLayout(false); this.stackPanel1.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false); this.flowPanel1.ResumeLayout(false);
this.flowPanel1.PerformLayout(); this.flowPanel1.PerformLayout();

View File

@ -2,6 +2,7 @@
using AntdUIDemo.Models; using AntdUIDemo.Models;
using AntdUIDemo.Views.Table; using AntdUIDemo.Views.Table;
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
@ -27,7 +28,11 @@ namespace AntdUIDemo.Views
{ {
table_base.Columns = new ColumnCollection() { table_base.Columns = new ColumnCollection() {
new ColumnCheck("Selected"){Fixed = true}, new ColumnCheck("Selected"){Fixed = true},
new Column("Name", "姓名",ColumnAlign.Center), new Column("Name", "姓名", ColumnAlign.Center)
{
Width="120",
KeyTree = "Users"
},
new Column("Age", "年龄",ColumnAlign.Center), new Column("Age", "年龄",ColumnAlign.Center),
new Column("Address", "地址"){ new Column("Address", "地址"){
Width = "120", Width = "120",
@ -263,27 +268,53 @@ namespace AntdUIDemo.Views
private void ButtonDEL_Click(object sender, EventArgs e) private void ButtonDEL_Click(object sender, EventArgs e)
{ {
if (antList.Count == 0 || !antList.Any(x => x.Selected)) if (antList.Count == 0 || !antList.Any(x => x.Selected))
{
bool isSubSelected = false;
// 判断子元素是否勾选
for (int i = 0; i < antList.Count; i++)
{
if (antList[i].Users !=null && antList[i].Users.Any(x => x.Selected))
{
isSubSelected = true;
break;
}
}
if (!isSubSelected)
{ {
AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3); AntdUI.Message.warn(window, "请选择要删除的行!", autoClose: 3);
return; return;
} }
}
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn); var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
if (result == DialogResult.OK) if (result == DialogResult.OK)
{ {
//使用反转for循环删除 // 使用反转for循环删除主列表中选中的项
for (int i = antList.Count - 1; i >= 0; i--) for (int i = antList.Count - 1; i >= 0; i--)
{ {
// 删除选中的主列表项
if (antList[i].Selected) if (antList[i].Selected)
{ {
antList.Remove(antList[i]); antList.RemoveAt(i);
}
else
{
// 删除子列表中选中的项
antList[i].Users = antList[i].Users?.Where(user => !user.Selected).ToArray();
} }
} }
//BUG:删除树节点数据需要重新绑定才刷新
table_base.Binding(antList);
// 提示删除完成
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
} }
} }
private void InitData() private void InitData()
{ {
antList = new AntList<User>(10); antList = new AntList<User>();
for (int i = 0; i < 10; i++) for (int i = 0; i < 10; i++)
{ {
@ -309,7 +340,35 @@ namespace AntdUIDemo.Views
CellDivider = new CellDivider(), CellDivider = new CellDivider(),
}); });
} }
table_base.Binding<User>(antList);
List<User> subUsers = new List<User>();
for (int i = 0; i < 3; i++)
{
subUsers.Add(new User()
{
Name = "李四",
Age = 30 + i,
Address = $"上海市东方明珠{i + 1}号",
Enabled = i % 2 == 0,
CellImages = new CellImage[] { new CellImage(Properties.Resources.head) },
CellTags = new CellTag[] { new CellTag("测试", TTypeMini.Primary) },
CellBadge = new CellBadge(TState.Success, "已完成"),
CellText = new CellText("这是一个带图标的文本")
{
IconRatio = 0.5f,
PrefixSvg = "<svg viewBox=\"64 64 896 896\" focusable=\"false\" data-icon=\"search\" width=\"1em\" height=\"1em\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z\"></path></svg>"
},
CellLinks = new CellLink[] {new CellLink("https://gitee.com/antdui/AntdUI", "AntdUI")},
//value:0-1
CellProgress = new CellProgress(1f),
CellDivider = new CellDivider(),
});
}
//设置树数据,可为任意行设置
antList[1].Users = subUsers.ToArray();
table_base.Binding(antList);
} }
} }
} }

View File

@ -52,6 +52,7 @@
this.timePicker1 = new AntdUI.TimePicker(); this.timePicker1 = new AntdUI.TimePicker();
this.label3 = new AntdUI.Label(); this.label3 = new AntdUI.Label();
this.header1 = new AntdUI.PageHeader(); this.header1 = new AntdUI.PageHeader();
this.timePicker14 = new AntdUI.TimePicker();
this.stackPanel1.SuspendLayout(); this.stackPanel1.SuspendLayout();
this.flowPanel4.SuspendLayout(); this.flowPanel4.SuspendLayout();
this.flowPanel3.SuspendLayout(); this.flowPanel3.SuspendLayout();
@ -289,6 +290,7 @@
// //
// flowPanel1 // flowPanel1
// //
this.flowPanel1.Controls.Add(this.timePicker14);
this.flowPanel1.Controls.Add(this.timePicker7); this.flowPanel1.Controls.Add(this.timePicker7);
this.flowPanel1.Controls.Add(this.timePicker1); this.flowPanel1.Controls.Add(this.timePicker1);
this.flowPanel1.Gap = 6; this.flowPanel1.Gap = 6;
@ -347,6 +349,20 @@
this.header1.Text = "TimePicker 时间选择框"; this.header1.Text = "TimePicker 时间选择框";
this.header1.UseTitleFont = true; this.header1.UseTitleFont = true;
// //
// timePicker14
//
this.timePicker14.DropDownArrow = true;
this.timePicker14.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.timePicker14.Location = new System.Drawing.Point(427, 3);
this.timePicker14.Name = "timePicker14";
this.timePicker14.PlaceholderText = "时间水平对齐";
this.timePicker14.Size = new System.Drawing.Size(200, 32);
this.timePicker14.TabIndex = 2;
this.timePicker14.Text = "08:00:00";
this.timePicker14.Value = System.TimeSpan.Parse("08:00:00");
this.timePicker14.ValueTimeHorizontal = true;
this.timePicker14.WaveSize = 0;
//
// TimePickerDemo // TimePickerDemo
// //
this.Controls.Add(this.stackPanel1); this.Controls.Add(this.stackPanel1);
@ -387,5 +403,6 @@
private AntdUI.TimePicker timePicker9; private AntdUI.TimePicker timePicker9;
private AntdUI.Label label6; private AntdUI.Label label6;
private AntdUI.PageHeader header1; private AntdUI.PageHeader header1;
private AntdUI.TimePicker timePicker14;
} }
} }