diff --git a/MainWindow.Designer.cs b/MainWindow.Designer.cs
index b62d04a..f209405 100644
--- a/MainWindow.Designer.cs
+++ b/MainWindow.Designer.cs
@@ -59,24 +59,36 @@
this.button_color.Dock = System.Windows.Forms.DockStyle.Right;
this.button_color.Ghost = true;
this.button_color.IconRatio = 0.6F;
- this.button_color.ImageSvg = resources.GetString("button_color.IconSvg");
+ this.button_color.IconSvg = resources.GetString("button_color.IconSvg");
+ this.button_color.Image = null;
+ this.button_color.ImageHover = null;
+ this.button_color.ImageHoverSvg = null;
+ this.button_color.ImageSize = new System.Drawing.Size(0, 0);
+ this.button_color.ImageSvg = resources.GetString("button_color.ImageSvg");
this.button_color.Location = new System.Drawing.Point(806, 0);
this.button_color.Name = "button_color";
this.button_color.Radius = 0;
this.button_color.Size = new System.Drawing.Size(50, 40);
this.button_color.TabIndex = 1;
+ this.button_color.ToggleType = null;
this.button_color.WaveSize = 0;
//
// buttonSZ
//
this.buttonSZ.Dock = System.Windows.Forms.DockStyle.Right;
this.buttonSZ.Ghost = true;
- this.buttonSZ.ImageSvg = resources.GetString("buttonSZ.IconSvg");
+ this.buttonSZ.IconSvg = resources.GetString("buttonSZ.IconSvg");
+ this.buttonSZ.Image = null;
+ this.buttonSZ.ImageHover = null;
+ this.buttonSZ.ImageHoverSvg = null;
+ this.buttonSZ.ImageSize = new System.Drawing.Size(0, 0);
+ this.buttonSZ.ImageSvg = resources.GetString("buttonSZ.ImageSvg");
this.buttonSZ.Location = new System.Drawing.Point(856, 0);
this.buttonSZ.Name = "buttonSZ";
this.buttonSZ.Radius = 0;
this.buttonSZ.Size = new System.Drawing.Size(50, 40);
this.buttonSZ.TabIndex = 0;
+ this.buttonSZ.ToggleType = null;
this.buttonSZ.WaveSize = 0;
//
// divider
@@ -122,6 +134,7 @@
//
// MainWindow
//
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1008, 624);
this.ControlBox = false;
this.Controls.Add(this.panel_content);
diff --git a/MainWindow.cs b/MainWindow.cs
index 5228527..dec1e97 100644
--- a/MainWindow.cs
+++ b/MainWindow.cs
@@ -178,6 +178,9 @@ namespace AntdUIDemo
case "DatePicker":
control = new DatePickerDemo();
break;
+ case "DatePickerRange":
+ control = new DatePickerRangeDemo();
+ break;
}
if (control != null)
{
diff --git a/MainWindow.resx b/MainWindow.resx
index 5c81609..25a8274 100644
--- a/MainWindow.resx
+++ b/MainWindow.resx
@@ -120,9 +120,15 @@
<svg t="1724123315714" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4689" width="200" height="200"><path d="M512 0C227.84 0 0 227.84 0 512s227.84 512 512 512 512-227.84 512-512S796.16 0 512 0z m0 977.408V46.592c256 0 465.408 209.408 465.408 465.408S768 977.408 512 977.408z" p-id="4690"></path></svg>
+
+ <svg t="1724123315714" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4689" width="200" height="200"><path d="M512 0C227.84 0 0 227.84 0 512s227.84 512 512 512 512-227.84 512-512S796.16 0 512 0z m0 977.408V46.592c256 0 465.408 209.408 465.408 465.408S768 977.408 512 977.408z" p-id="4690"></path></svg>
+
<svg t="1724122928419" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2893" width="200" height="200"><path d="M920.5 435.9c-7.6-40.3-36.1-66.8-69.8-66.2h-3.4c-36.6 0-66.3-29.7-66.3-66.3 0-7.8 3.6-19.1 6-24.9 15.4-35.1 3.3-78.1-28.9-100.6l-102-56.9-4.2-2c-31.7-13.7-72.7-5.4-96.4 19.2-15.1 15.6-42.2 33.7-54.6 33.7-12.5 0-39.8-18.5-54.9-34.3-23.6-24.9-62.2-34.4-97.4-19.5l-105.4 57.7-4.2 2.7c-31.7 22-43.8 65.3-28.3 100.1 1.9 4.6 6 16.7 6 24.9 0 36.6-29.7 66.3-66.3 66.3h-2.6c-34.9-0.6-63.1 25.8-70.7 66.2-0.9 4.8-8.9 48.2-8.9 84s8 79.2 8.9 84c7.5 39.6 35.3 66.2 69.2 66.2h4.1c36.6 0 66.3 29.7 66.3 66.3 0 8.2-4 20.3-5.8 24.5-15.6 35.2-3.6 78.4 28.9 101.2l99.8 56 4.1 2c10.5 4.6 21.8 6.9 33.6 6.9 24.5 0 47.8-9.9 63.7-27.3 14.8-16.1 43.5-35.8 55.8-35.8 12.8 0 40.8 19.7 56.1 36.5 15.8 17.4 39.8 27.8 64.2 27.8 11.6 0 22.6-2.2 34.3-7.3l103.2-56.9 4.2-2.7c31.6-22 43.7-65.2 28.1-100.4-1.9-4.6-5.9-16.5-5.9-24.6 0-36.6 29.7-66.3 66.3-66.3h4c34 0 61.7-26.4 69.2-65.9 0.1-0.5 9-46.3 9-84.4-0.1-35.9-8.1-79.1-9-83.9z m-71.3 154.6c-0.6 3.3-1.5 5.6-2.2 7.1-76.4 0.1-138.6 62.4-138.6 138.8 0 23 8.4 45.7 12.1 53.9 1.6 3.5 0.4 8.4-3.3 11.5l-96.4 53.3c-4.7 1.6-11.9-0.9-14.3-3.5-5.6-6.2-56.5-60.3-109.8-60.3-54 0-106.9 56.8-109.1 59.2-2.2 2.4-7.4 5.7-14.6 3.1l-93.1-52.1c-3.1-2.5-4.5-7.7-2.8-11.6 1.2-2.8 12-28.1 12-53.7 0-76.5-62.1-138.7-138.6-138.8-0.7-1.5-1.6-3.8-2.3-7.1-0.3-1.6-7.6-40.9-7.6-70.6 0-29.7 7.3-69 7.6-70.6 0.6-3.3 1.5-5.7 2.3-7.1 76.4-0.1 138.6-62.3 138.6-138.8 0-25-9.9-49.1-12.1-54-1.5-3.5-0.4-8.3 3.2-11.4l98.2-53.9c4.8-1.7 12.5 0.8 15 3.4 5.5 5.8 55.7 56.8 107.4 56.8 51.2 0 101.2-50 106.7-55.8 2.4-2.4 8.3-5.6 15.1-3.1l94.9 52.7c3.2 2.5 4.5 7.7 2.9 11.3l-0.7 1.8c-3.1 7.6-11.3 29.8-11.3 52.2 0 76.5 62.1 138.7 138.6 138.8 0.7 1.5 1.6 3.8 2.3 7.1 0.1 0.4 7.6 40.6 7.6 70.6-0.1 25.6-5.7 60.4-7.7 70.8z" p-id="2894"></path><path d="M498.7 355.9c-90.3 0-163.8 73.5-163.8 163.8 0 90.3 73.5 163.8 163.8 163.8 90.3 0 163.8-73.5 163.8-163.8 0-90.4-73.5-163.8-163.8-163.8z m0 273.1c-60.3 0-109.4-49.1-109.4-109.4 0-60.3 49.1-109.4 109.4-109.4 60.3 0 109.4 49.1 109.4 109.4 0 60.3-49.1 109.4-109.4 109.4z" p-id="2895"></path></svg>
+
+ <svg t="1724122928419" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2893" width="200" height="200"><path d="M920.5 435.9c-7.6-40.3-36.1-66.8-69.8-66.2h-3.4c-36.6 0-66.3-29.7-66.3-66.3 0-7.8 3.6-19.1 6-24.9 15.4-35.1 3.3-78.1-28.9-100.6l-102-56.9-4.2-2c-31.7-13.7-72.7-5.4-96.4 19.2-15.1 15.6-42.2 33.7-54.6 33.7-12.5 0-39.8-18.5-54.9-34.3-23.6-24.9-62.2-34.4-97.4-19.5l-105.4 57.7-4.2 2.7c-31.7 22-43.8 65.3-28.3 100.1 1.9 4.6 6 16.7 6 24.9 0 36.6-29.7 66.3-66.3 66.3h-2.6c-34.9-0.6-63.1 25.8-70.7 66.2-0.9 4.8-8.9 48.2-8.9 84s8 79.2 8.9 84c7.5 39.6 35.3 66.2 69.2 66.2h4.1c36.6 0 66.3 29.7 66.3 66.3 0 8.2-4 20.3-5.8 24.5-15.6 35.2-3.6 78.4 28.9 101.2l99.8 56 4.1 2c10.5 4.6 21.8 6.9 33.6 6.9 24.5 0 47.8-9.9 63.7-27.3 14.8-16.1 43.5-35.8 55.8-35.8 12.8 0 40.8 19.7 56.1 36.5 15.8 17.4 39.8 27.8 64.2 27.8 11.6 0 22.6-2.2 34.3-7.3l103.2-56.9 4.2-2.7c31.6-22 43.7-65.2 28.1-100.4-1.9-4.6-5.9-16.5-5.9-24.6 0-36.6 29.7-66.3 66.3-66.3h4c34 0 61.7-26.4 69.2-65.9 0.1-0.5 9-46.3 9-84.4-0.1-35.9-8.1-79.1-9-83.9z m-71.3 154.6c-0.6 3.3-1.5 5.6-2.2 7.1-76.4 0.1-138.6 62.4-138.6 138.8 0 23 8.4 45.7 12.1 53.9 1.6 3.5 0.4 8.4-3.3 11.5l-96.4 53.3c-4.7 1.6-11.9-0.9-14.3-3.5-5.6-6.2-56.5-60.3-109.8-60.3-54 0-106.9 56.8-109.1 59.2-2.2 2.4-7.4 5.7-14.6 3.1l-93.1-52.1c-3.1-2.5-4.5-7.7-2.8-11.6 1.2-2.8 12-28.1 12-53.7 0-76.5-62.1-138.7-138.6-138.8-0.7-1.5-1.6-3.8-2.3-7.1-0.3-1.6-7.6-40.9-7.6-70.6 0-29.7 7.3-69 7.6-70.6 0.6-3.3 1.5-5.7 2.3-7.1 76.4-0.1 138.6-62.3 138.6-138.8 0-25-9.9-49.1-12.1-54-1.5-3.5-0.4-8.3 3.2-11.4l98.2-53.9c4.8-1.7 12.5 0.8 15 3.4 5.5 5.8 55.7 56.8 107.4 56.8 51.2 0 101.2-50 106.7-55.8 2.4-2.4 8.3-5.6 15.1-3.1l94.9 52.7c3.2 2.5 4.5 7.7 2.9 11.3l-0.7 1.8c-3.1 7.6-11.3 29.8-11.3 52.2 0 76.5 62.1 138.7 138.6 138.8 0.7 1.5 1.6 3.8 2.3 7.1 0.1 0.4 7.6 40.6 7.6 70.6-0.1 25.6-5.7 60.4-7.7 70.8z" p-id="2894"></path><path d="M498.7 355.9c-90.3 0-163.8 73.5-163.8 163.8 0 90.3 73.5 163.8 163.8 163.8 90.3 0 163.8-73.5 163.8-163.8 0-90.4-73.5-163.8-163.8-163.8z m0 273.1c-60.3 0-109.4-49.1-109.4-109.4 0-60.3 49.1-109.4 109.4-109.4 60.3 0 109.4 49.1 109.4 109.4 0 60.3-49.1 109.4-109.4 109.4z" p-id="2895"></path></svg>
+
diff --git a/README.md b/README.md
index 1010429..d6f287e 100644
--- a/README.md
+++ b/README.md
@@ -6,14 +6,14 @@
```
1. git clone 或者直接下载本项目
-2. 若电脑分辨率不是 1920×1080(1080P) 或者缩放不是 100%,使用 Visual Studio 在 100% 缩放模式下(命令行使用 devenv /noScale 命令启动 Visual Studio)打开项目
+2. 若电脑分辨率不是 1920×1080(1080P) 或者缩放不是 100%,使用 Visual Studio 在 100% 缩放模式下(使用 devenv /noScale 命令启动 Visual Studio)打开项目
3. 若电脑没有安装 .NET Framework 4.8,编辑项目文件设置 TargetFramework 属性为自己安装的目标框架,兼容框架参照 AntdUI 项目
4. 编译运行
```
## ⚠️ 注意事项
-- 电脑屏幕分辨率低于 1920×1080(1080P) 请使用大于等于 1080P 分辨率的屏幕进行开发
+- 电脑屏幕分辨率低于 1920×1080(1080P) 请使用大于等于 1080P 分辨率的屏幕开发
- 电脑屏幕大于等于 1080P 分辨率或者缩放不是 100% 请务必按照上述 **快速开始** 的第二条步骤打开项目,详细原因见 [解决 Visual Studio 中 Windows 窗体设计器的 HDPI/缩放问题](https://learn.microsoft.com/zh-cn/visualstudio/designers/disable-dpi-awareness?view=vs-2022) ,具体启动方式如下图

diff --git a/Views/DatePickerDemo.Designer.cs b/Views/DatePickerDemo.Designer.cs
index 9c267f1..0220b60 100644
--- a/Views/DatePickerDemo.Designer.cs
+++ b/Views/DatePickerDemo.Designer.cs
@@ -30,34 +30,40 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatePickerDemo));
this.stackPanel1 = new AntdUI.StackPanel();
+ this.flowPanel3 = new AntdUI.FlowPanel();
+ this.datePicker7 = new AntdUI.DatePicker();
+ this.datePicker11 = new AntdUI.DatePicker();
+ this.label5 = new AntdUI.Label();
+ this.flowPanel2 = new AntdUI.FlowPanel();
+ this.datePicker8 = new AntdUI.DatePicker();
+ this.datePicker9 = new AntdUI.DatePicker();
+ this.datePicker12 = new AntdUI.DatePicker();
+ this.label4 = new AntdUI.Label();
this.flowPanel1 = new AntdUI.FlowPanel();
+ this.datePicker6 = new AntdUI.DatePicker();
+ this.datePicker5 = new AntdUI.DatePicker();
+ this.datePicker4 = new AntdUI.DatePicker();
+ this.datePicker3 = new AntdUI.DatePicker();
+ this.datePicker2 = new AntdUI.DatePicker();
+ this.datePicker1 = new AntdUI.DatePicker();
this.label3 = new AntdUI.Label();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
- this.datePicker1 = new AntdUI.DatePicker();
- this.datePicker2 = new AntdUI.DatePicker();
- this.datePicker3 = new AntdUI.DatePicker();
- this.datePicker4 = new AntdUI.DatePicker();
- this.datePicker5 = new AntdUI.DatePicker();
- this.datePicker6 = new AntdUI.DatePicker();
- this.label4 = new AntdUI.Label();
- this.flowPanel2 = new AntdUI.FlowPanel();
- this.datePicker12 = new AntdUI.DatePicker();
- this.datePicker9 = new AntdUI.DatePicker();
- this.datePicker8 = new AntdUI.DatePicker();
- this.label5 = new AntdUI.Label();
- this.flowPanel3 = new AntdUI.FlowPanel();
- this.datePicker11 = new AntdUI.DatePicker();
- this.datePicker7 = new AntdUI.DatePicker();
+ this.label6 = new AntdUI.Label();
+ this.flowPanel4 = new AntdUI.FlowPanel();
+ this.datePicker_badge = new AntdUI.DatePicker();
this.stackPanel1.SuspendLayout();
- this.flowPanel1.SuspendLayout();
- this.flowPanel2.SuspendLayout();
this.flowPanel3.SuspendLayout();
+ this.flowPanel2.SuspendLayout();
+ this.flowPanel1.SuspendLayout();
+ this.flowPanel4.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
+ this.stackPanel1.Controls.Add(this.flowPanel4);
+ this.stackPanel1.Controls.Add(this.label6);
this.stackPanel1.Controls.Add(this.flowPanel3);
this.stackPanel1.Controls.Add(this.label5);
this.stackPanel1.Controls.Add(this.flowPanel2);
@@ -75,6 +81,100 @@
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
+ // flowPanel3
+ //
+ this.flowPanel3.Controls.Add(this.datePicker7);
+ this.flowPanel3.Controls.Add(this.datePicker11);
+ 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 = 16;
+ this.flowPanel3.Text = "flowPanel3";
+ //
+ // datePicker7
+ //
+ this.datePicker7.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker7.Format = "yyyy/MM/dd";
+ this.datePicker7.Location = new System.Drawing.Point(116, 3);
+ this.datePicker7.Name = "datePicker7";
+ this.datePicker7.PlaceholderText = "yyyy/MM/dd";
+ this.datePicker7.Size = new System.Drawing.Size(107, 32);
+ this.datePicker7.TabIndex = 1;
+ this.datePicker7.WaveSize = 0;
+ //
+ // datePicker11
+ //
+ this.datePicker11.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker11.Location = new System.Drawing.Point(3, 3);
+ this.datePicker11.Name = "datePicker11";
+ this.datePicker11.PlaceholderText = "yyyy-MM-dd";
+ this.datePicker11.Size = new System.Drawing.Size(107, 32);
+ this.datePicker11.TabIndex = 0;
+ this.datePicker11.WaveSize = 0;
+ //
+ // 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, 245);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(694, 24);
+ this.label5.TabIndex = 15;
+ this.label5.Text = "日期格式化";
+ //
+ // flowPanel2
+ //
+ this.flowPanel2.Controls.Add(this.datePicker8);
+ this.flowPanel2.Controls.Add(this.datePicker9);
+ this.flowPanel2.Controls.Add(this.datePicker12);
+ this.flowPanel2.Location = new System.Drawing.Point(3, 201);
+ this.flowPanel2.Name = "flowPanel2";
+ this.flowPanel2.Size = new System.Drawing.Size(694, 38);
+ this.flowPanel2.TabIndex = 14;
+ this.flowPanel2.Text = "flowPanel2";
+ //
+ // datePicker8
+ //
+ this.datePicker8.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker8.Location = new System.Drawing.Point(229, 3);
+ this.datePicker8.Name = "datePicker8";
+ this.datePicker8.PlaceholderText = "图标在左";
+ this.datePicker8.PrefixSvg = resources.GetString("datePicker8.PrefixSvg");
+ this.datePicker8.ShowIcon = false;
+ this.datePicker8.Size = new System.Drawing.Size(107, 32);
+ this.datePicker8.TabIndex = 3;
+ this.datePicker8.WaveSize = 0;
+ //
+ // datePicker9
+ //
+ this.datePicker9.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker9.Location = new System.Drawing.Point(116, 3);
+ this.datePicker9.Name = "datePicker9";
+ this.datePicker9.PlaceholderText = "图标在右";
+ this.datePicker9.Size = new System.Drawing.Size(107, 32);
+ this.datePicker9.SuffixSvg = resources.GetString("datePicker9.SuffixSvg");
+ this.datePicker9.TabIndex = 2;
+ this.datePicker9.WaveSize = 0;
+ //
+ // datePicker12
+ //
+ this.datePicker12.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker12.Location = new System.Drawing.Point(3, 3);
+ this.datePicker12.Name = "datePicker12";
+ this.datePicker12.PlaceholderText = "无图标";
+ this.datePicker12.ShowIcon = false;
+ this.datePicker12.Size = new System.Drawing.Size(107, 32);
+ this.datePicker12.TabIndex = 0;
+ this.datePicker12.WaveSize = 0;
+ //
+ // 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, 171);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(694, 24);
+ this.label4.TabIndex = 13;
+ this.label4.Text = "图标显示";
+ //
// flowPanel1
//
this.flowPanel1.Controls.Add(this.datePicker6);
@@ -89,6 +189,71 @@
this.flowPanel1.TabIndex = 12;
this.flowPanel1.Text = "flowPanel1";
//
+ // datePicker6
+ //
+ this.datePicker6.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker6.Location = new System.Drawing.Point(568, 3);
+ this.datePicker6.Name = "datePicker6";
+ this.datePicker6.PlaceholderText = "TR";
+ this.datePicker6.Placement = AntdUI.TAlignFrom.TR;
+ this.datePicker6.Size = new System.Drawing.Size(107, 32);
+ this.datePicker6.TabIndex = 5;
+ this.datePicker6.WaveSize = 0;
+ //
+ // datePicker5
+ //
+ this.datePicker5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker5.Location = new System.Drawing.Point(455, 3);
+ this.datePicker5.Name = "datePicker5";
+ this.datePicker5.PlaceholderText = "Top";
+ this.datePicker5.Placement = AntdUI.TAlignFrom.Top;
+ this.datePicker5.Size = new System.Drawing.Size(107, 32);
+ this.datePicker5.TabIndex = 4;
+ this.datePicker5.WaveSize = 0;
+ //
+ // datePicker4
+ //
+ this.datePicker4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker4.Location = new System.Drawing.Point(342, 3);
+ this.datePicker4.Name = "datePicker4";
+ this.datePicker4.PlaceholderText = "TL";
+ this.datePicker4.Placement = AntdUI.TAlignFrom.TL;
+ this.datePicker4.Size = new System.Drawing.Size(107, 32);
+ this.datePicker4.TabIndex = 3;
+ this.datePicker4.WaveSize = 0;
+ //
+ // datePicker3
+ //
+ this.datePicker3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker3.Location = new System.Drawing.Point(229, 3);
+ this.datePicker3.Name = "datePicker3";
+ this.datePicker3.PlaceholderText = "BR";
+ this.datePicker3.Placement = AntdUI.TAlignFrom.BR;
+ this.datePicker3.Size = new System.Drawing.Size(107, 32);
+ this.datePicker3.TabIndex = 2;
+ this.datePicker3.WaveSize = 0;
+ //
+ // datePicker2
+ //
+ this.datePicker2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker2.Location = new System.Drawing.Point(116, 3);
+ this.datePicker2.Name = "datePicker2";
+ this.datePicker2.PlaceholderText = "Bottom";
+ this.datePicker2.Placement = AntdUI.TAlignFrom.Bottom;
+ this.datePicker2.Size = new System.Drawing.Size(107, 32);
+ this.datePicker2.TabIndex = 1;
+ this.datePicker2.WaveSize = 0;
+ //
+ // datePicker1
+ //
+ this.datePicker1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker1.Location = new System.Drawing.Point(3, 3);
+ this.datePicker1.Name = "datePicker1";
+ this.datePicker1.PlaceholderText = "BL";
+ this.datePicker1.Size = new System.Drawing.Size(107, 32);
+ this.datePicker1.TabIndex = 0;
+ this.datePicker1.WaveSize = 0;
+ //
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -123,164 +288,33 @@
this.label1.TabIndex = 8;
this.label1.Text = "DatePicker 日期选择器";
//
- // datePicker1
+ // label6
//
- this.datePicker1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker1.Location = new System.Drawing.Point(3, 3);
- this.datePicker1.Name = "datePicker1";
- this.datePicker1.PlaceholderText = "BL";
- this.datePicker1.Size = new System.Drawing.Size(107, 32);
- this.datePicker1.TabIndex = 0;
- this.datePicker1.WaveSize = 0;
+ 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, 319);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(694, 24);
+ this.label6.TabIndex = 17;
+ this.label6.Text = "日期徽标";
//
- // datePicker2
+ // flowPanel4
//
- this.datePicker2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker2.Location = new System.Drawing.Point(116, 3);
- this.datePicker2.Name = "datePicker2";
- this.datePicker2.PlaceholderText = "Bottom";
- this.datePicker2.Placement = AntdUI.TAlignFrom.Bottom;
- this.datePicker2.Size = new System.Drawing.Size(107, 32);
- this.datePicker2.TabIndex = 1;
- this.datePicker2.WaveSize = 0;
+ this.flowPanel4.Controls.Add(this.datePicker_badge);
+ this.flowPanel4.Location = new System.Drawing.Point(3, 349);
+ this.flowPanel4.Name = "flowPanel4";
+ this.flowPanel4.Size = new System.Drawing.Size(694, 38);
+ this.flowPanel4.TabIndex = 18;
+ this.flowPanel4.Text = "flowPanel4";
//
- // datePicker3
+ // datePicker_badge
//
- this.datePicker3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker3.Location = new System.Drawing.Point(229, 3);
- this.datePicker3.Name = "datePicker3";
- this.datePicker3.PlaceholderText = "BR";
- this.datePicker3.Placement = AntdUI.TAlignFrom.BR;
- this.datePicker3.Size = new System.Drawing.Size(107, 32);
- this.datePicker3.TabIndex = 2;
- this.datePicker3.WaveSize = 0;
- //
- // datePicker4
- //
- this.datePicker4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker4.Location = new System.Drawing.Point(342, 3);
- this.datePicker4.Name = "datePicker4";
- this.datePicker4.PlaceholderText = "TL";
- this.datePicker4.Placement = AntdUI.TAlignFrom.TL;
- this.datePicker4.Size = new System.Drawing.Size(107, 32);
- this.datePicker4.TabIndex = 3;
- this.datePicker4.WaveSize = 0;
- //
- // datePicker5
- //
- this.datePicker5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker5.Location = new System.Drawing.Point(455, 3);
- this.datePicker5.Name = "datePicker5";
- this.datePicker5.PlaceholderText = "Top";
- this.datePicker5.Placement = AntdUI.TAlignFrom.Top;
- this.datePicker5.Size = new System.Drawing.Size(107, 32);
- this.datePicker5.TabIndex = 4;
- this.datePicker5.WaveSize = 0;
- //
- // datePicker6
- //
- this.datePicker6.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker6.Location = new System.Drawing.Point(568, 3);
- this.datePicker6.Name = "datePicker6";
- this.datePicker6.PlaceholderText = "TR";
- this.datePicker6.Placement = AntdUI.TAlignFrom.TR;
- this.datePicker6.Size = new System.Drawing.Size(107, 32);
- this.datePicker6.TabIndex = 5;
- this.datePicker6.WaveSize = 0;
- //
- // 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, 171);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(694, 24);
- this.label4.TabIndex = 13;
- this.label4.Text = "图标显示";
- //
- // flowPanel2
- //
- this.flowPanel2.Controls.Add(this.datePicker8);
- this.flowPanel2.Controls.Add(this.datePicker9);
- this.flowPanel2.Controls.Add(this.datePicker12);
- this.flowPanel2.Location = new System.Drawing.Point(3, 201);
- this.flowPanel2.Name = "flowPanel2";
- this.flowPanel2.Size = new System.Drawing.Size(694, 38);
- this.flowPanel2.TabIndex = 14;
- this.flowPanel2.Text = "flowPanel2";
- //
- // datePicker12
- //
- this.datePicker12.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker12.Location = new System.Drawing.Point(3, 3);
- this.datePicker12.Name = "datePicker12";
- this.datePicker12.PlaceholderText = "无图标";
- this.datePicker12.ShowIcon = false;
- this.datePicker12.Size = new System.Drawing.Size(107, 32);
- this.datePicker12.TabIndex = 0;
- this.datePicker12.WaveSize = 0;
- //
- // datePicker9
- //
- this.datePicker9.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker9.Location = new System.Drawing.Point(116, 3);
- this.datePicker9.Name = "datePicker9";
- this.datePicker9.PlaceholderText = "图标在右";
- this.datePicker9.Size = new System.Drawing.Size(107, 32);
- this.datePicker9.SuffixSvg = resources.GetString("datePicker9.SuffixSvg");
- this.datePicker9.TabIndex = 2;
- this.datePicker9.WaveSize = 0;
- //
- // datePicker8
- //
- this.datePicker8.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker8.Location = new System.Drawing.Point(229, 3);
- this.datePicker8.Name = "datePicker8";
- this.datePicker8.PlaceholderText = "图标在左";
- this.datePicker8.PrefixSvg = resources.GetString("datePicker8.PrefixSvg");
- this.datePicker8.ShowIcon = false;
- this.datePicker8.Size = new System.Drawing.Size(107, 32);
- this.datePicker8.TabIndex = 3;
- this.datePicker8.WaveSize = 0;
- //
- // 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, 245);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(694, 24);
- this.label5.TabIndex = 15;
- this.label5.Text = "日期格式化";
- //
- // flowPanel3
- //
- this.flowPanel3.Controls.Add(this.datePicker7);
- this.flowPanel3.Controls.Add(this.datePicker11);
- 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 = 16;
- this.flowPanel3.Text = "flowPanel3";
- //
- // datePicker11
- //
- this.datePicker11.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker11.Location = new System.Drawing.Point(3, 3);
- this.datePicker11.Name = "datePicker11";
- this.datePicker11.PlaceholderText = "yyyy-MM-dd";
- this.datePicker11.Size = new System.Drawing.Size(107, 32);
- this.datePicker11.TabIndex = 0;
- this.datePicker11.WaveSize = 0;
- //
- // datePicker7
- //
- this.datePicker7.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.datePicker7.Format = "yyyy/MM/dd";
- this.datePicker7.Location = new System.Drawing.Point(116, 3);
- this.datePicker7.Name = "datePicker7";
- this.datePicker7.PlaceholderText = "yyyy/MM/dd";
- this.datePicker7.Size = new System.Drawing.Size(107, 32);
- this.datePicker7.TabIndex = 1;
- this.datePicker7.WaveSize = 0;
+ this.datePicker_badge.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePicker_badge.Location = new System.Drawing.Point(3, 3);
+ this.datePicker_badge.Name = "datePicker_badge";
+ this.datePicker_badge.PlaceholderText = "";
+ this.datePicker_badge.Size = new System.Drawing.Size(107, 32);
+ this.datePicker_badge.TabIndex = 0;
+ this.datePicker_badge.WaveSize = 0;
//
// DatePickerDemo
//
@@ -289,9 +323,10 @@
this.Name = "DatePickerDemo";
this.Size = new System.Drawing.Size(700, 471);
this.stackPanel1.ResumeLayout(false);
- this.flowPanel1.ResumeLayout(false);
- this.flowPanel2.ResumeLayout(false);
this.flowPanel3.ResumeLayout(false);
+ this.flowPanel2.ResumeLayout(false);
+ this.flowPanel1.ResumeLayout(false);
+ this.flowPanel4.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -319,5 +354,8 @@
private AntdUI.DatePicker datePicker7;
private AntdUI.DatePicker datePicker11;
private AntdUI.Label label5;
+ private AntdUI.FlowPanel flowPanel4;
+ private AntdUI.DatePicker datePicker_badge;
+ private AntdUI.Label label6;
}
}
diff --git a/Views/DatePickerDemo.cs b/Views/DatePickerDemo.cs
index b2e8058..becf6f9 100644
--- a/Views/DatePickerDemo.cs
+++ b/Views/DatePickerDemo.cs
@@ -15,6 +15,21 @@ namespace AntdUIDemo.Views
public DatePickerDemo()
{
InitializeComponent();
+ InitData();
+ }
+
+ private void InitData()
+ {
+ DateTime now = DateTime.Now;
+ datePicker_badge.BadgeAction = dates =>
+ {
+ return new List
+ {
+ new AntdUI.DateBadge(now.AddDays(5).ToString("yyyy-MM-dd"),99,Color.Red),
+ new AntdUI.DateBadge(now.AddDays(1).ToString("yyyy-MM-dd"),2,Color.Red),
+ new AntdUI.DateBadge(now.AddDays(-3).ToString("yyyy-MM-dd"),8,Color.FromArgb(14, 176, 201)),
+ };
+ };
}
}
}
diff --git a/Views/DatePickerRangeDemo.Designer.cs b/Views/DatePickerRangeDemo.Designer.cs
new file mode 100644
index 0000000..621eba4
--- /dev/null
+++ b/Views/DatePickerRangeDemo.Designer.cs
@@ -0,0 +1,177 @@
+namespace AntdUIDemo.Views
+{
+ partial class DatePickerRangeDemo
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region 组件设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ this.stackPanel1 = new AntdUI.StackPanel();
+ this.divider1 = new AntdUI.Divider();
+ this.label2 = new AntdUI.Label();
+ this.label1 = new AntdUI.Label();
+ this.flowPanel2 = new AntdUI.FlowPanel();
+ this.datePickerRange1 = new AntdUI.DatePickerRange();
+ this.label4 = new AntdUI.Label();
+ this.flowPanel1 = new AntdUI.FlowPanel();
+ this.datePickerRange = new AntdUI.DatePickerRange();
+ this.label3 = new AntdUI.Label();
+ this.stackPanel1.SuspendLayout();
+ this.flowPanel2.SuspendLayout();
+ this.flowPanel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // stackPanel1
+ //
+ this.stackPanel1.Controls.Add(this.flowPanel1);
+ this.stackPanel1.Controls.Add(this.label3);
+ this.stackPanel1.Controls.Add(this.flowPanel2);
+ 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, 426);
+ 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 = 13;
+ //
+ // 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 = 12;
+ 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 = 11;
+ this.label1.Text = "DatePickerRange 日期范围选择器";
+ //
+ // flowPanel2
+ //
+ this.flowPanel2.Controls.Add(this.datePickerRange1);
+ this.flowPanel2.Location = new System.Drawing.Point(3, 127);
+ this.flowPanel2.Name = "flowPanel2";
+ this.flowPanel2.Size = new System.Drawing.Size(694, 38);
+ this.flowPanel2.TabIndex = 17;
+ this.flowPanel2.Text = "flowPanel2";
+ //
+ // datePickerRange1
+ //
+ this.datePickerRange1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePickerRange1.Location = new System.Drawing.Point(3, 3);
+ this.datePickerRange1.Name = "datePickerRange1";
+ this.datePickerRange1.PlaceholderEnd = "结束日期";
+ this.datePickerRange1.PlaceholderStart = "开始日期";
+ this.datePickerRange1.Size = new System.Drawing.Size(300, 32);
+ this.datePickerRange1.TabIndex = 0;
+ this.datePickerRange1.WaveSize = 0;
+ //
+ // 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 = 16;
+ this.label4.Text = "基本用法";
+ //
+ // flowPanel1
+ //
+ this.flowPanel1.Controls.Add(this.datePickerRange);
+ 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 = 19;
+ this.flowPanel1.Text = "flowPanel1";
+ //
+ // datePickerRange
+ //
+ this.datePickerRange.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ this.datePickerRange.Location = new System.Drawing.Point(3, 3);
+ this.datePickerRange.Name = "datePickerRange";
+ this.datePickerRange.Presets.AddRange(new object[] {
+ "本周",
+ "上周",
+ "本月",
+ "上月",
+ "本年",
+ "去年"});
+ this.datePickerRange.Size = new System.Drawing.Size(300, 32);
+ this.datePickerRange.TabIndex = 0;
+ this.datePickerRange.WaveSize = 0;
+ //
+ // 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 = 18;
+ this.label3.Text = "预置菜单";
+ //
+ // DatePickerRangeDemo
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.Controls.Add(this.stackPanel1);
+ this.Name = "DatePickerRangeDemo";
+ this.Size = new System.Drawing.Size(700, 426);
+ this.stackPanel1.ResumeLayout(false);
+ this.flowPanel2.ResumeLayout(false);
+ this.flowPanel1.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 flowPanel1;
+ private AntdUI.DatePickerRange datePickerRange;
+ private AntdUI.Label label3;
+ private AntdUI.FlowPanel flowPanel2;
+ private AntdUI.DatePickerRange datePickerRange1;
+ private AntdUI.Label label4;
+ }
+}
diff --git a/Views/DatePickerRangeDemo.cs b/Views/DatePickerRangeDemo.cs
new file mode 100644
index 0000000..328af96
--- /dev/null
+++ b/Views/DatePickerRangeDemo.cs
@@ -0,0 +1,72 @@
+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 DatePickerRangeDemo : UserControl
+ {
+ public DatePickerRangeDemo()
+ {
+ InitializeComponent();
+ // 绑定事件
+ BindEventHandler();
+ }
+
+ private void BindEventHandler()
+ {
+ datePickerRange.PresetsClickChanged += DatePickerRange_PresetsClickChanged;
+ }
+
+ private void DatePickerRange_PresetsClickChanged(object sender, object value)
+ {
+ DateTime today = DateTime.Today;
+ string str = value.ToString();
+ switch (str)
+ {
+ case "本周":
+ int daysToMonday = (int)today.DayOfWeek - (int)DayOfWeek.Monday;
+ if (daysToMonday < 0)
+ daysToMonday += 7;
+ DateTime startOfWeek = today.AddDays(-daysToMonday);
+ DateTime endOfWeek = startOfWeek.AddDays(6);
+ datePickerRange.Value = new DateTime[] { startOfWeek, endOfWeek };
+ break;
+ case "上周":
+ daysToMonday = (int)today.DayOfWeek - (int)DayOfWeek.Monday;
+ if (daysToMonday < 0)
+ daysToMonday += 7;
+ startOfWeek = today.AddDays(-daysToMonday - 7);
+ endOfWeek = startOfWeek.AddDays(6);
+ datePickerRange.Value = new DateTime[] { startOfWeek, endOfWeek };
+ break;
+ case "本月":
+ startOfWeek = new DateTime(today.Year, today.Month, 1);
+ endOfWeek = startOfWeek.AddMonths(1).AddDays(-1);
+ datePickerRange.Value = new DateTime[] { startOfWeek, endOfWeek };
+ break;
+ case "上月":
+ startOfWeek = new DateTime(today.Year, today.Month, 1);
+ endOfWeek = startOfWeek.AddMonths(1).AddDays(-1);
+ datePickerRange.Value = new DateTime[] { startOfWeek, endOfWeek };
+ break;
+ case "本年":
+ startOfWeek = new DateTime(today.Year, 1, 1);
+ endOfWeek = startOfWeek.AddYears(1).AddDays(-1);
+ datePickerRange.Value = new DateTime[] { startOfWeek, endOfWeek };
+ break;
+ case "去年":
+ startOfWeek = new DateTime(today.Year - 1, 1, 1);
+ endOfWeek = startOfWeek.AddYears(1).AddDays(-1);
+ datePickerRange.Value = new DateTime[] { startOfWeek, endOfWeek };
+ break;
+ }
+ }
+ }
+}
diff --git a/Views/DatePickerRangeDemo.resx b/Views/DatePickerRangeDemo.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/Views/DatePickerRangeDemo.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Views/StackPanelDemo.cs b/Views/StackPanelDemo.cs
index fb1c5b7..5fbc5a4 100644
--- a/Views/StackPanelDemo.cs
+++ b/Views/StackPanelDemo.cs
@@ -35,11 +35,12 @@ namespace AntdUIDemo.Views
stackPanel.Vertical = select_vertical.SelectedIndex == 0;
stackPanel.Controls.Clear();
- for (int i= 0; i < 3; i++){
+ for (int i = 1; i < 4; i++)
+ {
var control = new AntdUI.Button()
{
- Margin=new Padding(0),
- Padding=new Padding(3),
+ Margin = new Padding(0),
+ Padding = new Padding(3),
Text = $"Button{i}",
Type = TTypeMini.Primary,
WaveSize = 0,
@@ -104,7 +105,7 @@ namespace AntdUIDemo.Views
{
Margin = new Padding(0),
Padding = new Padding(3),
- Text = $"Button{stackPanel.Controls.Count}",
+ Text = $"Button{stackPanel.Controls.Count+1}",
Type = TTypeMini.Primary,
WaveSize = 0,
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
diff --git a/assets/screenshots/DatePicker.png b/assets/screenshots/DatePicker.png
index bcc3fda..7fa041a 100644
Binary files a/assets/screenshots/DatePicker.png and b/assets/screenshots/DatePicker.png differ