Compare commits

...

1 Commits

Author SHA1 Message Date
czz_y
92d20d473c 升级1.9.12,Button新增动画示例,Table新增单元格绘制 2025-04-28 09:28:31 +08:00
12 changed files with 84 additions and 14 deletions

View File

@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AntdUI" Version="1.9.11" />
<PackageReference Include="AntdUI" Version="1.9.12" />
<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View File

@ -68,6 +68,8 @@ namespace AntdUIDemo.Languages
return "Gradient";
case "toggle":
return "Toggle";
case "animate":
return "Animate";
#endregion
#region FloatButton

View File

@ -63,7 +63,7 @@
this.titlebar.Size = new System.Drawing.Size(1024, 40);
this.titlebar.SubText = "Demo";
this.titlebar.TabIndex = 0;
this.titlebar.Text = "AntdUI 1.9.11";
this.titlebar.Text = "AntdUI 1.9.12";
//
// input_search
//

View File

@ -18,7 +18,7 @@ namespace AntdUIDemo
AntdUI.Localization.DefaultLanguage = "zh-CN";
//若文字不清晰,切换其他渲染方式
AntdUI.Config.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
AntdUI.Config.SetCorrectionTextRendering("Microsoft YaHei UI");
AntdUI.Config.TextRenderingHighQuality = true;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

View File

@ -4,7 +4,7 @@
<h1>AntdUI Demo</h1>
This project is developed based on `Winform .NET Framework 4.8`, and is a demo project of [AntdUI](https://gitee.com/antdui/AntdUI), the current version is `1.9.11`
This project is developed based on `Winform .NET Framework 4.8`, and is a demo project of [AntdUI](https://gitee.com/antdui/AntdUI), the current version is `1.9.12`
</div>

View File

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

View File

@ -105,6 +105,9 @@
this.button2 = new AntdUI.Button();
this.button1 = new AntdUI.Button();
this.label3 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.flowPanel11 = new AntdUI.FlowPanel();
this.button_animate = new AntdUI.Button();
this.stackPanel1.SuspendLayout();
this.flowPanel8.SuspendLayout();
this.flowPanel7.SuspendLayout();
@ -118,6 +121,7 @@
this.flowPanel10.SuspendLayout();
this.flowPanel9.SuspendLayout();
this.flowPanel1.SuspendLayout();
this.flowPanel11.SuspendLayout();
this.SuspendLayout();
//
// header1
@ -139,6 +143,8 @@
// stackPanel1
//
this.stackPanel1.AutoScroll = true;
this.stackPanel1.Controls.Add(this.flowPanel11);
this.stackPanel1.Controls.Add(this.label1);
this.stackPanel1.Controls.Add(this.flowPanel8);
this.stackPanel1.Controls.Add(this.label10);
this.stackPanel1.Controls.Add(this.flowPanel7);
@ -162,7 +168,7 @@
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, 840);
this.stackPanel1.Size = new System.Drawing.Size(750, 907);
this.stackPanel1.TabIndex = 1;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
@ -1064,12 +1070,40 @@
this.label3.TabIndex = 5;
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.LocalizationText = "animate";
this.label1.Location = new System.Drawing.Point(3, 791);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(744, 24);
this.label1.TabIndex = 53;
this.label1.Text = "动画按钮";
//
// flowPanel11
//
this.flowPanel11.Controls.Add(this.button_animate);
this.flowPanel11.Location = new System.Drawing.Point(3, 821);
this.flowPanel11.Name = "flowPanel11";
this.flowPanel11.Size = new System.Drawing.Size(744, 44);
this.flowPanel11.TabIndex = 54;
this.flowPanel11.Text = "flowPanel11";
//
// button_animate
//
this.button_animate.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button_animate.Location = new System.Drawing.Point(3, 3);
this.button_animate.Name = "button_animate";
this.button_animate.Size = new System.Drawing.Size(80, 38);
this.button_animate.TabIndex = 1;
this.button_animate.Type = AntdUI.TTypeMini.Primary;
//
// ButtonDemo
//
this.Controls.Add(this.stackPanel1);
this.Controls.Add(this.header1);
this.Name = "ButtonDemo";
this.Size = new System.Drawing.Size(750, 914);
this.Size = new System.Drawing.Size(750, 981);
this.stackPanel1.ResumeLayout(false);
this.flowPanel8.ResumeLayout(false);
this.flowPanel7.ResumeLayout(false);
@ -1083,6 +1117,7 @@
this.flowPanel10.ResumeLayout(false);
this.flowPanel9.ResumeLayout(false);
this.flowPanel1.ResumeLayout(false);
this.flowPanel11.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -1165,5 +1200,8 @@
private AntdUI.Button button49;
private AntdUI.Button button48;
private AntdUI.Button button_toggle3;
private AntdUI.Label label1;
private AntdUI.FlowPanel flowPanel11;
private AntdUI.Button button_animate;
}
}

View File

@ -24,6 +24,20 @@ namespace AntdUIDemo.Views
button_toggle.Click += Button_toggle_Click;
button_toggle2.Click += Button_toggle_Click;
button_toggle3.Click += Button_toggle_Click;
button_animate.Click += Button_animate_Click;
}
private void Button_animate_Click(object sender, EventArgs e)
{
if (button_animate.AnimationBlinkState)
{
button_animate.StopAnimationBlink();
}
else
{
button_animate.AnimationBlinkTransition(500,10, AntdUI.AnimationType.Ease, Color.FromArgb(255, 0, 0), Color.FromArgb(0, 255, 0), Color.FromArgb(0, 0, 255));
}
}
private void Button_toggle_Click(object sender, EventArgs e)

View File

@ -24,7 +24,7 @@ namespace AntdUIDemo.Views.SubView
{
config.Text = "LOADING...";
//耗时代码,处理数据
Thread.Sleep(2000);
Thread.Sleep(1000);
}, () =>
{
//结束时执行的代码

View File

@ -79,7 +79,7 @@
// table_base
//
this.table_base.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill;
this.table_base.Dock = System.Windows.Forms.DockStyle.Top;
this.table_base.Dock = System.Windows.Forms.DockStyle.Fill;
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.Gap = 8;
@ -87,7 +87,7 @@
this.table_base.MultipleRows = true;
this.table_base.Name = "table_base";
this.table_base.ShowTip = false;
this.table_base.Size = new System.Drawing.Size(744, 417);
this.table_base.Size = new System.Drawing.Size(744, 459);
this.table_base.TabIndex = 30;
this.table_base.Text = "table1";
//

View File

@ -28,6 +28,11 @@ namespace AntdUIDemo.Views
private void InitTableColumns()
{
table_base.Columns = new ColumnCollection() {
new Column("","序号"){
Width = "50",
Render = (value,record,rowindex)=>{return (rowindex+1); },
Fixed = true,//冻结列
},
new ColumnCheck("Selected"){Fixed = true},
new Column("Name", "姓名", ColumnAlign.Center)
{
@ -58,10 +63,7 @@ namespace AntdUIDemo.Views
},
new Column("CellProgress", "进度条",ColumnAlign.Center),
new Column("CellDivider", "分割线",ColumnAlign.Center),
new Column("CellLinks", "链接", ColumnAlign.Center)
{
Fixed = true,//冻结列
},
new Column("CellLinks", "链接", ColumnAlign.Center),
};
//设置多表头
@ -87,6 +89,20 @@ namespace AntdUIDemo.Views
table_base.CellClick += Table_base_CellClick;
table_base.CellButtonClick += Table_base_CellButtonClick;
table_base.CellPaint += Table_base_CellPaint;
}
private void Table_base_CellPaint(object sender, TablePaintEventArgs e)
{
if (e.Index == 4 && e.RowIndex == 2)
{
e.g.Fill(Color.FromArgb(80, 0, 255, 0), e.Rect);
}
else if (e.Index == 4 && e.RowIndex == 6)
{
int size = (int)(14 * AntdUI.Config.Dpi);
e.g.FillPolygon(Brushes.Red, new Point[] { new Point(e.Rect.X, e.Rect.Y), new Point(e.Rect.X + size, e.Rect.Y), new Point(e.Rect.X, e.Rect.Y + size) });
}
}
private void Checkbox_rowstyle_CheckedChanged(object sender, BoolEventArgs e)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 254 KiB