👾 修复 Button 多行文本异常、AutoSize 调整 Button/Checkbox/Radio/ColorPicker

This commit is contained in:
Tom
2025-08-27 14:59:37 +08:00
parent ece14fcf88
commit 6522069b36
32 changed files with 309 additions and 267 deletions

View File

@@ -159,16 +159,16 @@ namespace Demo.Controls
badge1.AutoSizeMode = AntdUI.TAutoSize.Auto;
badge1.Location = new Point(3, 3);
badge1.Name = "badge1";
badge1.Size = new Size(86, 23);
badge1.Size = new Size(87, 23);
badge1.TabIndex = 0;
badge1.Text = "Default";
//
// badge2
//
badge2.AutoSizeMode = AntdUI.TAutoSize.Auto;
badge2.Location = new Point(95, 3);
badge2.Location = new Point(96, 3);
badge2.Name = "badge2";
badge2.Size = new Size(90, 23);
badge2.Size = new Size(91, 23);
badge2.State = AntdUI.TState.Success;
badge2.TabIndex = 1;
badge2.Text = "Success";
@@ -176,9 +176,9 @@ namespace Demo.Controls
// badge3
//
badge3.AutoSizeMode = AntdUI.TAutoSize.Auto;
badge3.Location = new Point(191, 3);
badge3.Location = new Point(193, 3);
badge3.Name = "badge3";
badge3.Size = new Size(89, 23);
badge3.Size = new Size(90, 23);
badge3.State = AntdUI.TState.Primary;
badge3.TabIndex = 2;
badge3.Text = "Primary";
@@ -186,9 +186,9 @@ namespace Demo.Controls
// badge4
//
badge4.AutoSizeMode = AntdUI.TAutoSize.Auto;
badge4.Location = new Point(286, 3);
badge4.Location = new Point(289, 3);
badge4.Name = "badge4";
badge4.Size = new Size(114, 23);
badge4.Size = new Size(117, 23);
badge4.State = AntdUI.TState.Processing;
badge4.TabIndex = 3;
badge4.Text = "Processing";
@@ -196,9 +196,9 @@ namespace Demo.Controls
// badge5
//
badge5.AutoSizeMode = AntdUI.TAutoSize.Auto;
badge5.Location = new Point(406, 3);
badge5.Location = new Point(412, 3);
badge5.Name = "badge5";
badge5.Size = new Size(96, 23);
badge5.Size = new Size(98, 23);
badge5.State = AntdUI.TState.Warn;
badge5.TabIndex = 4;
badge5.Text = "Warning";
@@ -206,9 +206,9 @@ namespace Demo.Controls
// badge6
//
badge6.AutoSizeMode = AntdUI.TAutoSize.Auto;
badge6.Location = new Point(508, 3);
badge6.Location = new Point(516, 3);
badge6.Name = "badge6";
badge6.Size = new Size(67, 23);
badge6.Size = new Size(66, 23);
badge6.State = AntdUI.TState.Error;
badge6.TabIndex = 5;
badge6.Text = "Error";
@@ -237,7 +237,7 @@ namespace Demo.Controls
flowLayoutPanel2.Dock = DockStyle.Top;
flowLayoutPanel2.Location = new Point(0, 146);
flowLayoutPanel2.Name = "flowLayoutPanel2";
flowLayoutPanel2.Size = new Size(616, 52);
flowLayoutPanel2.Size = new Size(616, 46);
flowLayoutPanel2.TabIndex = 2;
//
// divider2
@@ -245,7 +245,7 @@ namespace Demo.Controls
divider2.Dock = DockStyle.Top;
divider2.Font = new Font("Microsoft YaHei UI", 10F);
divider2.LocalizationText = "Badge.{id}";
divider2.Location = new Point(0, 198);
divider2.Location = new Point(0, 192);
divider2.Name = "divider2";
divider2.Orientation = AntdUI.TOrientation.Left;
divider2.Size = new Size(616, 28);
@@ -260,9 +260,9 @@ namespace Demo.Controls
flowLayoutPanel3.Controls.Add(button4);
flowLayoutPanel3.Controls.Add(button6);
flowLayoutPanel3.Dock = DockStyle.Top;
flowLayoutPanel3.Location = new Point(0, 226);
flowLayoutPanel3.Location = new Point(0, 220);
flowLayoutPanel3.Name = "flowLayoutPanel3";
flowLayoutPanel3.Size = new Size(616, 121);
flowLayoutPanel3.Size = new Size(616, 94);
flowLayoutPanel3.TabIndex = 3;
//
// button1
@@ -272,7 +272,7 @@ namespace Demo.Controls
button1.BorderWidth = 1F;
button1.Location = new Point(3, 3);
button1.Name = "button1";
button1.Size = new Size(87, 47);
button1.Size = new Size(81, 46);
button1.TabIndex = 0;
button1.Text = "Button";
//
@@ -281,9 +281,9 @@ namespace Demo.Controls
button2.AutoSizeMode = AntdUI.TAutoSize.Auto;
button2.Badge = " ";
button2.BorderWidth = 1F;
button2.Location = new Point(96, 3);
button2.Location = new Point(90, 3);
button2.Name = "button2";
button2.Size = new Size(63, 47);
button2.Size = new Size(58, 46);
button2.TabIndex = 1;
button2.Text = "Dot";
//
@@ -296,9 +296,9 @@ namespace Demo.Controls
button3.BadgeSize = 0.8F;
button3.BadgeSvg = "CheckSquareFilled";
button3.BorderWidth = 1F;
button3.Location = new Point(165, 3);
button3.Location = new Point(154, 3);
button3.Name = "button3";
button3.Size = new Size(67, 47);
button3.Size = new Size(61, 46);
button3.TabIndex = 2;
button3.Text = "SVG";
//
@@ -306,7 +306,7 @@ namespace Demo.Controls
//
button4.BorderWidth = 1F;
button4.Controls.Add(button5);
button4.Location = new Point(238, 3);
button4.Location = new Point(221, 3);
button4.Name = "button4";
button4.Padding = new Padding(10);
button4.Size = new Size(107, 69);
@@ -329,7 +329,7 @@ namespace Demo.Controls
//
button6.BorderWidth = 1F;
button6.Controls.Add(tag1);
button6.Location = new Point(351, 3);
button6.Location = new Point(334, 3);
button6.Name = "button6";
button6.Padding = new Padding(10);
button6.Size = new Size(130, 69);

View File

@@ -163,7 +163,7 @@ namespace Demo.Controls
panel6.Controls.Add(panel_btns);
panel6.Controls.Add(panel7);
panel6.Dock = DockStyle.Top;
panel6.Location = new Point(0, 553);
panel6.Location = new Point(0, 524);
panel6.Name = "panel6";
panel6.Size = new Size(845, 100);
panel6.TabIndex = 5;
@@ -174,11 +174,11 @@ namespace Demo.Controls
panel_btns.Controls.Add(btng2);
panel_btns.Controls.Add(btng1);
panel_btns.Font = new Font("Microsoft YaHei UI", 10F);
panel_btns.Location = new Point(14, 10);
panel_btns.Location = new Point(4, 4);
panel_btns.Name = "panel_btns";
panel_btns.Padding = new Padding(4);
panel_btns.Shadow = 18;
panel_btns.Size = new Size(417, 83);
panel_btns.Size = new Size(389, 80);
panel_btns.TabIndex = 0;
panel_btns.Text = "panel6";
//
@@ -189,10 +189,10 @@ namespace Demo.Controls
btng3.BorderWidth = 2F;
btng3.Dock = DockStyle.Left;
btng3.JoinMode = AntdUI.TJoinMode.Right;
btng3.Location = new Point(264, 22);
btng3.Location = new Point(252, 22);
btng3.Margin = new Padding(0);
btng3.Name = "btng3";
btng3.Size = new Size(121, 39);
btng3.Size = new Size(115, 36);
btng3.TabIndex = 2;
btng3.Text = "Default Button";
btng3.Click += Btns;
@@ -204,10 +204,10 @@ namespace Demo.Controls
btng2.BorderWidth = 2F;
btng2.Dock = DockStyle.Left;
btng2.JoinMode = AntdUI.TJoinMode.LR;
btng2.Location = new Point(143, 22);
btng2.Location = new Point(137, 22);
btng2.Margin = new Padding(0);
btng2.Name = "btng2";
btng2.Size = new Size(121, 39);
btng2.Size = new Size(115, 36);
btng2.TabIndex = 1;
btng2.Text = "Default Button";
btng2.Click += Btns;
@@ -222,7 +222,7 @@ namespace Demo.Controls
btng1.Location = new Point(22, 22);
btng1.Margin = new Padding(0);
btng1.Name = "btng1";
btng1.Size = new Size(121, 39);
btng1.Size = new Size(115, 36);
btng1.TabIndex = 0;
btng1.Text = "Default Button";
btng1.Click += Btns;
@@ -232,9 +232,9 @@ namespace Demo.Controls
panel7.Controls.Add(button41);
panel7.Controls.Add(button40);
panel7.Font = new Font("Microsoft YaHei UI", 14F);
panel7.Location = new Point(482, 27);
panel7.Location = new Point(440, 25);
panel7.Name = "panel7";
panel7.Size = new Size(147, 40);
panel7.Size = new Size(140, 38);
panel7.TabIndex = 1;
//
// button41
@@ -244,10 +244,10 @@ namespace Demo.Controls
button41.BackHover = Color.FromArgb(17, 24, 39);
button41.Dock = DockStyle.Fill;
button41.JoinMode = AntdUI.TJoinMode.Right;
button41.Location = new Point(50, 0);
button41.Location = new Point(46, 0);
button41.Name = "button41";
button41.Radius = 4;
button41.Size = new Size(97, 40);
button41.Size = new Size(94, 38);
button41.TabIndex = 1;
button41.Text = "Button";
button41.Type = AntdUI.TTypeMini.Primary;
@@ -264,7 +264,7 @@ namespace Demo.Controls
button40.Location = new Point(0, 0);
button40.Name = "button40";
button40.Radius = 4;
button40.Size = new Size(50, 40);
button40.Size = new Size(46, 38);
button40.TabIndex = 0;
button40.Type = AntdUI.TTypeMini.Primary;
button40.WaveSize = 0;
@@ -275,7 +275,7 @@ namespace Demo.Controls
divider5.Dock = DockStyle.Top;
divider5.Font = new Font("Microsoft YaHei UI", 10F);
divider5.LocalizationText = "Button.{id}";
divider5.Location = new Point(0, 525);
divider5.Location = new Point(0, 496);
divider5.Name = "divider5";
divider5.Orientation = AntdUI.TOrientation.Left;
divider5.Size = new Size(845, 28);
@@ -303,9 +303,9 @@ namespace Demo.Controls
panel5.Controls.Add(button34);
panel5.Controls.Add(button35);
panel5.Dock = DockStyle.Top;
panel5.Location = new Point(0, 414);
panel5.Location = new Point(0, 396);
panel5.Name = "panel5";
panel5.Size = new Size(845, 111);
panel5.Size = new Size(845, 100);
panel5.TabIndex = 4;
//
// button30
@@ -315,7 +315,7 @@ namespace Demo.Controls
button30.IconSvg = "SearchOutlined";
button30.Location = new Point(3, 3);
button30.Name = "button30";
button30.Size = new Size(115, 47);
button30.Size = new Size(100, 46);
button30.TabIndex = 0;
button30.Text = "Button";
button30.Type = AntdUI.TTypeMini.Primary;
@@ -327,9 +327,9 @@ namespace Demo.Controls
button31.BorderWidth = 1F;
button31.IconPosition = AntdUI.TAlignMini.Right;
button31.IconSvg = "SearchOutlined";
button31.Location = new Point(124, 3);
button31.Location = new Point(113, 3);
button31.Name = "button31";
button31.Size = new Size(115, 47);
button31.Size = new Size(100, 46);
button31.TabIndex = 1;
button31.Text = "Button";
button31.Type = AntdUI.TTypeMini.Primary;
@@ -340,9 +340,9 @@ namespace Demo.Controls
button36.AutoSizeMode = AntdUI.TAutoSize.Auto;
button36.BorderWidth = 1F;
button36.IconSvg = "SearchOutlined";
button36.Location = new Point(3, 56);
button36.Location = new Point(3, 52);
button36.Name = "button36";
button36.Size = new Size(115, 47);
button36.Size = new Size(100, 46);
button36.TabIndex = 6;
button36.Text = "Button";
button36.Click += Btn;
@@ -353,9 +353,9 @@ namespace Demo.Controls
button37.BorderWidth = 1F;
button37.IconPosition = AntdUI.TAlignMini.Right;
button37.IconSvg = "SearchOutlined";
button37.Location = new Point(124, 56);
button37.Location = new Point(113, 52);
button37.Name = "button37";
button37.Size = new Size(115, 47);
button37.Size = new Size(100, 46);
button37.TabIndex = 7;
button37.Text = "Button";
button37.Click += Btn;
@@ -369,9 +369,9 @@ namespace Demo.Controls
button32.LoadingWaveCount = 4;
button32.LoadingWaveSize = 6;
button32.LoadingWaveVertical = true;
button32.Location = new Point(245, 3);
button32.Location = new Point(223, 3);
button32.Name = "button32";
button32.Size = new Size(115, 75);
button32.Size = new Size(77, 69);
button32.TabIndex = 2;
button32.Text = "Button";
button32.Type = AntdUI.TTypeMini.Primary;
@@ -386,9 +386,9 @@ namespace Demo.Controls
button33.LoadingWaveCount = 4;
button33.LoadingWaveSize = 6;
button33.LoadingWaveVertical = true;
button33.Location = new Point(366, 3);
button33.Location = new Point(310, 3);
button33.Name = "button33";
button33.Size = new Size(115, 75);
button33.Size = new Size(77, 69);
button33.TabIndex = 3;
button33.Text = "Button";
button33.Type = AntdUI.TTypeMini.Primary;
@@ -403,9 +403,9 @@ namespace Demo.Controls
button34.LoadingWaveCount = 4;
button34.LoadingWaveSize = 6;
button34.LoadingWaveVertical = true;
button34.Location = new Point(487, 3);
button34.Location = new Point(397, 3);
button34.Name = "button34";
button34.Size = new Size(115, 75);
button34.Size = new Size(77, 69);
button34.TabIndex = 4;
button34.Text = "Button";
button34.Click += Btn;
@@ -419,9 +419,9 @@ namespace Demo.Controls
button35.LoadingWaveCount = 4;
button35.LoadingWaveSize = 6;
button35.LoadingWaveVertical = true;
button35.Location = new Point(608, 3);
button35.Location = new Point(484, 3);
button35.Name = "button35";
button35.Size = new Size(115, 75);
button35.Size = new Size(77, 69);
button35.TabIndex = 5;
button35.Text = "Button";
button35.Click += Btn;
@@ -432,7 +432,7 @@ namespace Demo.Controls
divider4.Dock = DockStyle.Top;
divider4.Font = new Font("Microsoft YaHei UI", 10F);
divider4.LocalizationText = "Button.{id}";
divider4.Location = new Point(0, 386);
divider4.Location = new Point(0, 368);
divider4.Name = "divider4";
divider4.Orientation = AntdUI.TOrientation.Left;
divider4.Size = new Size(845, 28);
@@ -459,9 +459,9 @@ namespace Demo.Controls
panel4.Controls.Add(button25);
panel4.Controls.Add(button26);
panel4.Dock = DockStyle.Top;
panel4.Location = new Point(0, 277);
panel4.Location = new Point(0, 268);
panel4.Name = "panel4";
panel4.Size = new Size(845, 109);
panel4.Size = new Size(845, 100);
panel4.TabIndex = 3;
//
// button20
@@ -471,7 +471,7 @@ namespace Demo.Controls
button20.Location = new Point(3, 3);
button20.Name = "button20";
button20.ShowArrow = true;
button20.Size = new Size(106, 47);
button20.Size = new Size(100, 46);
button20.TabIndex = 0;
button20.Text = "Button";
button20.Type = AntdUI.TTypeMini.Primary;
@@ -482,10 +482,10 @@ namespace Demo.Controls
button21.AutoSizeMode = AntdUI.TAutoSize.Auto;
button21.BorderWidth = 1F;
button21.IconSvg = "SearchOutlined";
button21.Location = new Point(115, 3);
button21.Location = new Point(109, 3);
button21.Name = "button21";
button21.ShowArrow = true;
button21.Size = new Size(133, 47);
button21.Size = new Size(119, 46);
button21.TabIndex = 1;
button21.Text = "Button";
button21.Type = AntdUI.TTypeMini.Primary;
@@ -497,10 +497,10 @@ namespace Demo.Controls
button22.BorderWidth = 1F;
button22.IconSvg = "PoweroffOutlined";
button22.IsLink = true;
button22.Location = new Point(254, 3);
button22.Location = new Point(234, 3);
button22.Name = "button22";
button22.ShowArrow = true;
button22.Size = new Size(133, 47);
button22.Size = new Size(119, 46);
button22.TabIndex = 2;
button22.Text = "Button";
button22.Click += Btn;
@@ -510,10 +510,10 @@ namespace Demo.Controls
button23.AutoSizeMode = AntdUI.TAutoSize.Auto;
button23.BorderWidth = 1F;
button23.Ghost = true;
button23.Location = new Point(393, 3);
button23.Location = new Point(359, 3);
button23.Name = "button23";
button23.ShowArrow = true;
button23.Size = new Size(106, 47);
button23.Size = new Size(100, 46);
button23.TabIndex = 3;
button23.Text = "Button";
button23.Type = AntdUI.TTypeMini.Primary;
@@ -523,10 +523,10 @@ namespace Demo.Controls
//
button24.AutoSizeMode = AntdUI.TAutoSize.Auto;
button24.BorderWidth = 1F;
button24.Location = new Point(505, 3);
button24.Location = new Point(465, 3);
button24.Name = "button24";
button24.ShowArrow = true;
button24.Size = new Size(106, 47);
button24.Size = new Size(100, 46);
button24.TabIndex = 4;
button24.Text = "Button";
button24.Type = AntdUI.TTypeMini.Error;
@@ -538,10 +538,10 @@ namespace Demo.Controls
button25.BorderWidth = 1F;
button25.Ghost = true;
button25.IsLink = true;
button25.Location = new Point(617, 3);
button25.Location = new Point(571, 3);
button25.Name = "button25";
button25.ShowArrow = true;
button25.Size = new Size(106, 47);
button25.Size = new Size(100, 46);
button25.TabIndex = 5;
button25.Text = "Button";
button25.Click += Btn;
@@ -551,10 +551,10 @@ namespace Demo.Controls
button26.AutoSizeMode = AntdUI.TAutoSize.Auto;
button26.Ghost = true;
button26.IsLink = true;
button26.Location = new Point(729, 3);
button26.Location = new Point(677, 3);
button26.Name = "button26";
button26.ShowArrow = true;
button26.Size = new Size(106, 47);
button26.Size = new Size(100, 46);
button26.TabIndex = 6;
button26.Text = "Button";
button26.Click += Btn;
@@ -565,7 +565,7 @@ namespace Demo.Controls
divider3.Dock = DockStyle.Top;
divider3.Font = new Font("Microsoft YaHei UI", 10F);
divider3.LocalizationText = "Button.{id}";
divider3.Location = new Point(0, 249);
divider3.Location = new Point(0, 240);
divider3.Name = "divider3";
divider3.Orientation = AntdUI.TOrientation.Left;
divider3.Size = new Size(845, 28);
@@ -590,9 +590,9 @@ namespace Demo.Controls
panel3.Controls.Add(button53);
panel3.Controls.Add(button54);
panel3.Dock = DockStyle.Top;
panel3.Location = new Point(0, 194);
panel3.Location = new Point(0, 188);
panel3.Name = "panel3";
panel3.Size = new Size(845, 55);
panel3.Size = new Size(845, 52);
panel3.TabIndex = 2;
//
// button50
@@ -602,7 +602,7 @@ namespace Demo.Controls
button50.LoadingWaveVertical = true;
button50.Location = new Point(3, 3);
button50.Name = "button50";
button50.Size = new Size(47, 47);
button50.Size = new Size(46, 46);
button50.TabIndex = 0;
button50.Type = AntdUI.TTypeMini.Primary;
button50.Click += Btn;
@@ -612,10 +612,10 @@ namespace Demo.Controls
button51.AutoSizeMode = AntdUI.TAutoSize.Auto;
button51.IconSvg = "DownloadOutlined";
button51.LoadingWaveVertical = true;
button51.Location = new Point(56, 3);
button51.Location = new Point(55, 3);
button51.Name = "button51";
button51.Shape = AntdUI.TShape.Circle;
button51.Size = new Size(47, 47);
button51.Size = new Size(46, 46);
button51.TabIndex = 1;
button51.Type = AntdUI.TTypeMini.Primary;
button51.Click += Btn;
@@ -625,10 +625,10 @@ namespace Demo.Controls
button52.AutoSizeMode = AntdUI.TAutoSize.Height;
button52.IconSvg = "DownloadOutlined";
button52.LoadingWaveVertical = true;
button52.Location = new Point(109, 3);
button52.Location = new Point(107, 3);
button52.Name = "button52";
button52.Shape = AntdUI.TShape.Round;
button52.Size = new Size(67, 47);
button52.Size = new Size(67, 46);
button52.TabIndex = 2;
button52.Type = AntdUI.TTypeMini.Primary;
button52.Click += Btn;
@@ -637,10 +637,10 @@ namespace Demo.Controls
//
button53.AutoSizeMode = AntdUI.TAutoSize.Auto;
button53.IconSvg = "DownloadOutlined";
button53.Location = new Point(182, 3);
button53.Location = new Point(180, 3);
button53.Name = "button53";
button53.Shape = AntdUI.TShape.Round;
button53.Size = new Size(143, 47);
button53.Size = new Size(127, 46);
button53.TabIndex = 3;
button53.Text = "Download";
button53.Type = AntdUI.TTypeMini.Primary;
@@ -650,9 +650,9 @@ namespace Demo.Controls
//
button54.AutoSizeMode = AntdUI.TAutoSize.Auto;
button54.IconSvg = "DownloadOutlined";
button54.Location = new Point(331, 3);
button54.Location = new Point(313, 3);
button54.Name = "button54";
button54.Size = new Size(143, 47);
button54.Size = new Size(127, 46);
button54.TabIndex = 4;
button54.Text = "Download";
button54.Type = AntdUI.TTypeMini.Primary;
@@ -664,7 +664,7 @@ namespace Demo.Controls
divider6.Dock = DockStyle.Top;
divider6.Font = new Font("Microsoft YaHei UI", 10F);
divider6.LocalizationText = "Button.{id}";
divider6.Location = new Point(0, 166);
divider6.Location = new Point(0, 160);
divider6.Name = "divider6";
divider6.Orientation = AntdUI.TOrientation.Left;
divider6.Size = new Size(845, 28);
@@ -691,9 +691,9 @@ namespace Demo.Controls
panel2.Controls.Add(button15);
panel2.Controls.Add(button16);
panel2.Dock = DockStyle.Top;
panel2.Location = new Point(0, 111);
panel2.Location = new Point(0, 108);
panel2.Name = "panel2";
panel2.Size = new Size(845, 55);
panel2.Size = new Size(845, 52);
panel2.TabIndex = 1;
//
// button10
@@ -704,7 +704,7 @@ namespace Demo.Controls
button10.Location = new Point(3, 3);
button10.Name = "button10";
button10.Shape = AntdUI.TShape.Circle;
button10.Size = new Size(47, 47);
button10.Size = new Size(46, 46);
button10.TabIndex = 0;
button10.Type = AntdUI.TTypeMini.Primary;
button10.Click += Btn;
@@ -714,9 +714,9 @@ namespace Demo.Controls
button11.AutoSizeMode = AntdUI.TAutoSize.Auto;
button11.IconSvg = "SearchOutlined";
button11.LocalizationText = "Button.Search";
button11.Location = new Point(56, 3);
button11.Location = new Point(55, 3);
button11.Name = "button11";
button11.Size = new Size(95, 47);
button11.Size = new Size(80, 46);
button11.TabIndex = 1;
button11.Text = "搜索";
button11.Type = AntdUI.TTypeMini.Primary;
@@ -728,10 +728,10 @@ namespace Demo.Controls
button12.BorderWidth = 1F;
button12.IconSvg = "PoweroffOutlined";
button12.LoadingWaveVertical = true;
button12.Location = new Point(157, 3);
button12.Location = new Point(141, 3);
button12.Name = "button12";
button12.Shape = AntdUI.TShape.Circle;
button12.Size = new Size(47, 47);
button12.Size = new Size(46, 46);
button12.TabIndex = 2;
button12.Click += Btn;
//
@@ -741,9 +741,9 @@ namespace Demo.Controls
button13.BorderWidth = 1F;
button13.IconSvg = "SearchOutlined";
button13.LocalizationText = "Button.Search";
button13.Location = new Point(210, 3);
button13.Location = new Point(193, 3);
button13.Name = "button13";
button13.Size = new Size(95, 47);
button13.Size = new Size(80, 46);
button13.TabIndex = 3;
button13.Text = "搜索";
button13.Click += Btn;
@@ -754,10 +754,10 @@ namespace Demo.Controls
button14.BorderWidth = 2F;
button14.IconSvg = "SearchOutlined";
button14.LoadingWaveVertical = true;
button14.Location = new Point(311, 3);
button14.Location = new Point(279, 3);
button14.Name = "button14";
button14.Shape = AntdUI.TShape.Circle;
button14.Size = new Size(47, 47);
button14.Size = new Size(46, 46);
button14.TabIndex = 4;
button14.Type = AntdUI.TTypeMini.Error;
button14.Click += Btn;
@@ -767,9 +767,9 @@ namespace Demo.Controls
button15.AutoSizeMode = AntdUI.TAutoSize.Auto;
button15.IconSvg = "SearchOutlined";
button15.LocalizationText = "Button.Search";
button15.Location = new Point(364, 3);
button15.Location = new Point(331, 3);
button15.Name = "button15";
button15.Size = new Size(95, 47);
button15.Size = new Size(80, 46);
button15.TabIndex = 5;
button15.Text = "搜索";
button15.Type = AntdUI.TTypeMini.Error;
@@ -780,9 +780,9 @@ namespace Demo.Controls
button16.AutoSizeMode = AntdUI.TAutoSize.Auto;
button16.BackExtend = "135, #6253E1, #04BEFE";
button16.IconSvg = "SearchOutlined";
button16.Location = new Point(465, 3);
button16.Location = new Point(417, 3);
button16.Name = "button16";
button16.Size = new Size(188, 47);
button16.Size = new Size(171, 46);
button16.TabIndex = 6;
button16.Text = "Gradient Button";
button16.Type = AntdUI.TTypeMini.Primary;
@@ -794,7 +794,7 @@ namespace Demo.Controls
divider2.Dock = DockStyle.Top;
divider2.Font = new Font("Microsoft YaHei UI", 10F);
divider2.LocalizationText = "Button.{id}";
divider2.Location = new Point(0, 83);
divider2.Location = new Point(0, 80);
divider2.Name = "divider2";
divider2.Orientation = AntdUI.TOrientation.Left;
divider2.Size = new Size(845, 28);
@@ -821,7 +821,7 @@ namespace Demo.Controls
panel1.Dock = DockStyle.Top;
panel1.Location = new Point(0, 28);
panel1.Name = "panel1";
panel1.Size = new Size(845, 55);
panel1.Size = new Size(845, 52);
panel1.TabIndex = 0;
//
// button1
@@ -829,7 +829,7 @@ namespace Demo.Controls
button1.AutoSizeMode = AntdUI.TAutoSize.Auto;
button1.Location = new Point(3, 3);
button1.Name = "button1";
button1.Size = new Size(152, 47);
button1.Size = new Size(145, 46);
button1.TabIndex = 0;
button1.Text = "Primary Button";
button1.Type = AntdUI.TTypeMini.Primary;
@@ -839,9 +839,9 @@ namespace Demo.Controls
//
button2.AutoSizeMode = AntdUI.TAutoSize.Auto;
button2.BorderWidth = 1F;
button2.Location = new Point(161, 3);
button2.Location = new Point(154, 3);
button2.Name = "button2";
button2.Size = new Size(150, 47);
button2.Size = new Size(142, 46);
button2.TabIndex = 1;
button2.Text = "Default Button";
button2.Click += Btn;
@@ -850,9 +850,9 @@ namespace Demo.Controls
//
button3.AutoSizeMode = AntdUI.TAutoSize.Auto;
button3.Ghost = true;
button3.Location = new Point(317, 3);
button3.Location = new Point(302, 3);
button3.Name = "button3";
button3.Size = new Size(125, 47);
button3.Size = new Size(118, 46);
button3.TabIndex = 2;
button3.Text = "Text Button";
button3.Click += Btn;
@@ -860,9 +860,9 @@ namespace Demo.Controls
// button4
//
button4.AutoSizeMode = AntdUI.TAutoSize.Auto;
button4.Location = new Point(448, 3);
button4.Location = new Point(426, 3);
button4.Name = "button4";
button4.Size = new Size(92, 47);
button4.Size = new Size(86, 46);
button4.TabIndex = 3;
button4.Text = "Danger";
button4.Type = AntdUI.TTypeMini.Error;
@@ -873,9 +873,9 @@ namespace Demo.Controls
button5.AutoSizeMode = AntdUI.TAutoSize.Auto;
button5.BorderWidth = 2F;
button5.Ghost = true;
button5.Location = new Point(546, 3);
button5.Location = new Point(518, 3);
button5.Name = "button5";
button5.Size = new Size(154, 47);
button5.Size = new Size(146, 46);
button5.TabIndex = 4;
button5.Text = "Danger Default";
button5.Type = AntdUI.TTypeMini.Error;

View File

@@ -107,9 +107,9 @@ namespace Demo.Controls
panel4.Controls.Add(panel5);
panel4.Controls.Add(checkbox9);
panel4.Dock = DockStyle.Top;
panel4.Location = new Point(0, 184);
panel4.Location = new Point(0, 180);
panel4.Name = "panel4";
panel4.Size = new Size(650, 96);
panel4.Size = new Size(650, 90);
panel4.TabIndex = 5;
//
// panel5
@@ -126,9 +126,9 @@ namespace Demo.Controls
//
button2.AutoSizeMode = AntdUI.TAutoSize.Width;
button2.Dock = DockStyle.Left;
button2.Location = new Point(83, 0);
button2.Location = new Point(74, 0);
button2.Name = "button2";
button2.Size = new Size(76, 38);
button2.Size = new Size(67, 38);
button2.TabIndex = 1;
button2.Text = "Disable";
button2.Type = AntdUI.TTypeMini.Primary;
@@ -140,7 +140,7 @@ namespace Demo.Controls
button1.Dock = DockStyle.Left;
button1.Location = new Point(0, 0);
button1.Name = "button1";
button1.Size = new Size(83, 38);
button1.Size = new Size(74, 38);
button1.TabIndex = 0;
button1.Text = "Uncheck";
button1.Type = AntdUI.TTypeMini.Primary;
@@ -152,7 +152,7 @@ namespace Demo.Controls
checkbox9.Checked = true;
checkbox9.Location = new Point(0, 0);
checkbox9.Name = "checkbox9";
checkbox9.Size = new Size(187, 43);
checkbox9.Size = new Size(176, 42);
checkbox9.TabIndex = 0;
checkbox9.Text = "Checked-Enabled";
checkbox9.CheckedChanged += checkbox9_CheckedChanged;
@@ -163,7 +163,7 @@ namespace Demo.Controls
divider3.Dock = DockStyle.Top;
divider3.Font = new Font("Microsoft YaHei UI", 10F);
divider3.LocalizationText = "Checkbox.{id}";
divider3.Location = new Point(0, 156);
divider3.Location = new Point(0, 152);
divider3.Name = "divider3";
divider3.Orientation = AntdUI.TOrientation.Left;
divider3.Size = new Size(650, 28);
@@ -177,9 +177,9 @@ namespace Demo.Controls
panel3.Controls.Add(checkbox6);
panel3.Controls.Add(checkbox5);
panel3.Dock = DockStyle.Top;
panel3.Location = new Point(0, 106);
panel3.Location = new Point(0, 104);
panel3.Name = "panel3";
panel3.Size = new Size(650, 50);
panel3.Size = new Size(650, 48);
panel3.TabIndex = 1;
//
// checkbox8
@@ -189,9 +189,9 @@ namespace Demo.Controls
checkbox8.Dock = DockStyle.Left;
checkbox8.Enabled = false;
checkbox8.Fill = Color.FromArgb(100, 0, 0);
checkbox8.Location = new Point(359, 0);
checkbox8.Location = new Point(334, 0);
checkbox8.Name = "checkbox8";
checkbox8.Size = new Size(121, 50);
checkbox8.Size = new Size(113, 48);
checkbox8.TabIndex = 7;
checkbox8.Text = "Option D";
//
@@ -200,9 +200,9 @@ namespace Demo.Controls
checkbox7.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox7.Dock = DockStyle.Left;
checkbox7.Fill = Color.FromArgb(150, 0, 0);
checkbox7.Location = new Point(239, 0);
checkbox7.Location = new Point(223, 0);
checkbox7.Name = "checkbox7";
checkbox7.Size = new Size(120, 50);
checkbox7.Size = new Size(111, 48);
checkbox7.TabIndex = 6;
checkbox7.Text = "Option C";
//
@@ -211,9 +211,9 @@ namespace Demo.Controls
checkbox6.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox6.Dock = DockStyle.Left;
checkbox6.Fill = Color.FromArgb(200, 0, 0);
checkbox6.Location = new Point(120, 0);
checkbox6.Location = new Point(112, 0);
checkbox6.Name = "checkbox6";
checkbox6.Size = new Size(119, 50);
checkbox6.Size = new Size(111, 48);
checkbox6.TabIndex = 5;
checkbox6.Text = "Option B";
//
@@ -224,7 +224,7 @@ namespace Demo.Controls
checkbox5.Fill = Color.FromArgb(250, 0, 0);
checkbox5.Location = new Point(0, 0);
checkbox5.Name = "checkbox5";
checkbox5.Size = new Size(120, 50);
checkbox5.Size = new Size(112, 48);
checkbox5.TabIndex = 4;
checkbox5.Text = "Option A";
//
@@ -233,7 +233,7 @@ namespace Demo.Controls
divider2.Dock = DockStyle.Top;
divider2.Font = new Font("Microsoft YaHei UI", 10F);
divider2.LocalizationText = "Checkbox.{id}";
divider2.Location = new Point(0, 78);
divider2.Location = new Point(0, 76);
divider2.Name = "divider2";
divider2.Orientation = AntdUI.TOrientation.Left;
divider2.Size = new Size(650, 28);
@@ -249,7 +249,7 @@ namespace Demo.Controls
panel2.Dock = DockStyle.Top;
panel2.Location = new Point(0, 28);
panel2.Name = "panel2";
panel2.Size = new Size(650, 50);
panel2.Size = new Size(650, 48);
panel2.TabIndex = 0;
//
// checkbox4
@@ -257,9 +257,9 @@ namespace Demo.Controls
checkbox4.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox4.Dock = DockStyle.Left;
checkbox4.Enabled = false;
checkbox4.Location = new Point(354, 0);
checkbox4.Location = new Point(330, 0);
checkbox4.Name = "checkbox4";
checkbox4.Size = new Size(118, 50);
checkbox4.Size = new Size(110, 48);
checkbox4.TabIndex = 3;
checkbox4.Text = "Option 4";
//
@@ -267,9 +267,9 @@ namespace Demo.Controls
//
checkbox3.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox3.Dock = DockStyle.Left;
checkbox3.Location = new Point(236, 0);
checkbox3.Location = new Point(220, 0);
checkbox3.Name = "checkbox3";
checkbox3.Size = new Size(118, 50);
checkbox3.Size = new Size(110, 48);
checkbox3.TabIndex = 2;
checkbox3.Text = "Option 3";
//
@@ -277,9 +277,9 @@ namespace Demo.Controls
//
checkbox2.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox2.Dock = DockStyle.Left;
checkbox2.Location = new Point(118, 0);
checkbox2.Location = new Point(110, 0);
checkbox2.Name = "checkbox2";
checkbox2.Size = new Size(118, 50);
checkbox2.Size = new Size(110, 48);
checkbox2.TabIndex = 1;
checkbox2.Text = "Option 2";
//
@@ -289,7 +289,7 @@ namespace Demo.Controls
checkbox1.Dock = DockStyle.Left;
checkbox1.Location = new Point(0, 0);
checkbox1.Name = "checkbox1";
checkbox1.Size = new Size(118, 50);
checkbox1.Size = new Size(110, 48);
checkbox1.TabIndex = 0;
checkbox1.Text = "Option 1";
//

View File

@@ -49,8 +49,8 @@ namespace Demo.Controls
header1 = new AntdUI.PageHeader();
flowLayoutPanel1 = new FlowLayoutPanel();
colorPicker3 = new AntdUI.ColorPicker();
colorPicker2 = new AntdUI.ColorPicker();
colorPicker1 = new AntdUI.ColorPicker();
colorPicker2 = new AntdUI.ColorPicker();
flowLayoutPanel1.SuspendLayout();
SuspendLayout();
//
@@ -86,36 +86,35 @@ namespace Demo.Controls
colorPicker3.AutoSizeMode = AntdUI.TAutoSize.Auto;
colorPicker3.Location = new Point(3, 3);
colorPicker3.Name = "colorPicker3";
colorPicker3.Size = new Size(47, 47);
colorPicker3.Size = new Size(46, 46);
colorPicker3.TabIndex = 26;
colorPicker3.Value = Color.FromArgb(22, 119, 255);
//
// colorPicker2
//
colorPicker2.AutoSizeMode = AntdUI.TAutoSize.Auto;
colorPicker2.Location = new Point(3, 3);
colorPicker2.Name = "colorPicker2";
colorPicker2.Size = new Size(128, 128);
colorPicker2.TabIndex = 26;
colorPicker2.Value = Color.FromArgb(22, 119, 255);
colorPicker2.Round = true;
colorPicker2.ShowClose = true;
colorPicker2.ShowReset = true;
colorPicker2.AllowClear = true;
colorPicker2.ShowText = false;
colorPicker2.ShowSymbol = true;
colorPicker2.Text = "C";
//
// colorPicker1
//
colorPicker1.AutoSizeMode = AntdUI.TAutoSize.Auto;
colorPicker1.Location = new Point(56, 3);
colorPicker1.Location = new Point(55, 3);
colorPicker1.Name = "colorPicker1";
colorPicker1.ShowText = true;
colorPicker1.Size = new Size(134, 47);
colorPicker1.Size = new Size(125, 46);
colorPicker1.TabIndex = 26;
colorPicker1.Value = Color.FromArgb(22, 119, 255);
//
// colorPicker2
//
colorPicker2.AllowClear = true;
colorPicker2.AutoSizeMode = AntdUI.TAutoSize.Auto;
colorPicker2.Location = new Point(186, 3);
colorPicker2.Name = "colorPicker2";
colorPicker2.Round = true;
colorPicker2.ShowClose = true;
colorPicker2.ShowReset = true;
colorPicker2.ShowSymbol = true;
colorPicker2.Size = new Size(46, 46);
colorPicker2.TabIndex = 26;
colorPicker2.Text = "C";
colorPicker2.Value = Color.FromArgb(22, 119, 255);
//
// ColorPicker
//
Controls.Add(flowLayoutPanel1);

View File

@@ -87,11 +87,11 @@ namespace Demo.Controls
button7.AutoSizeMode = AntdUI.TAutoSize.Auto;
button7.IconSvg = "PoweroffOutlined";
button7.Items.AddRange(new object[] { "菜单1", "菜单2", "菜单3" });
button7.Location = new Point(371, 3);
button7.Location = new Point(350, 3);
button7.Name = "button7";
button7.Placement = AntdUI.TAlignFrom.BR;
button7.Shape = AntdUI.TShape.Circle;
button7.Size = new Size(47, 47);
button7.Size = new Size(46, 46);
button7.TabIndex = 0;
button7.Type = AntdUI.TTypeMini.Primary;
//
@@ -117,9 +117,9 @@ namespace Demo.Controls
panel1.Controls.Add(button3);
panel1.Controls.Add(button8);
panel1.Dock = DockStyle.Top;
panel1.Location = new Point(0, 129);
panel1.Location = new Point(0, 108);
panel1.Name = "panel1";
panel1.Size = new Size(1300, 196);
panel1.Size = new Size(1300, 160);
panel1.TabIndex = 8;
//
// button4
@@ -131,7 +131,7 @@ namespace Demo.Controls
button4.Location = new Point(296, 93);
button4.Name = "button4";
button4.Placement = AntdUI.TAlignFrom.BR;
button4.Size = new Size(163, 47);
button4.Size = new Size(147, 46);
button4.TabIndex = 2;
button4.Text = "bottomRight";
button4.Type = AntdUI.TTypeMini.Primary;
@@ -142,10 +142,10 @@ namespace Demo.Controls
button6.DropDownArrow = true;
button6.IconSvg = "BorderBottomOutlined";
button6.Items.AddRange(new object[] { "one st menu item", "two nd menu item", "three rd menu item", "four menu item", "five menu item", "six six six menu item" });
button6.Location = new Point(171, 93);
button6.Location = new Point(169, 93);
button6.Name = "button6";
button6.Placement = AntdUI.TAlignFrom.Bottom;
button6.Size = new Size(121, 47);
button6.Size = new Size(106, 46);
button6.TabIndex = 3;
button6.Text = "bottom";
button6.Type = AntdUI.TTypeMini.Primary;
@@ -156,10 +156,10 @@ namespace Demo.Controls
button2.DropDownArrow = true;
button2.IconSvg = "RadiusUprightOutlined";
button2.Items.AddRange(new object[] { "one st menu item", "two nd menu item", "three rd menu item", "four menu item", "five menu item", "six six six menu item" });
button2.Location = new Point(328, 15);
button2.Location = new Point(327, 15);
button2.Name = "button2";
button2.Placement = AntdUI.TAlignFrom.TR;
button2.Size = new Size(131, 47);
button2.Size = new Size(116, 46);
button2.TabIndex = 4;
button2.Text = "topRight";
button2.Type = AntdUI.TTypeMini.Primary;
@@ -170,10 +170,10 @@ namespace Demo.Controls
button5.DropDownArrow = true;
button5.IconSvg = "BorderTopOutlined";
button5.Items.AddRange(new object[] { "one st menu item", "two nd menu item", "three rd menu item", "four menu item", "five menu item", "six six six menu item" });
button5.Location = new Point(187, 15);
button5.Location = new Point(185, 15);
button5.Name = "button5";
button5.Placement = AntdUI.TAlignFrom.Top;
button5.Size = new Size(89, 47);
button5.Size = new Size(75, 46);
button5.TabIndex = 5;
button5.Text = "top";
button5.Type = AntdUI.TTypeMini.Primary;
@@ -186,7 +186,7 @@ namespace Demo.Controls
button3.Items.AddRange(new object[] { "one st menu item", "two nd menu item", "three rd menu item", "four menu item", "five menu item", "six six six menu item" });
button3.Location = new Point(14, 93);
button3.Name = "button3";
button3.Size = new Size(151, 47);
button3.Size = new Size(135, 46);
button3.TabIndex = 6;
button3.Text = "bottomLeft";
button3.Type = AntdUI.TTypeMini.Primary;
@@ -200,7 +200,7 @@ namespace Demo.Controls
button8.Location = new Point(14, 15);
button8.Name = "button8";
button8.Placement = AntdUI.TAlignFrom.TL;
button8.Size = new Size(119, 47);
button8.Size = new Size(104, 46);
button8.TabIndex = 7;
button8.Text = "topLeft";
button8.Type = AntdUI.TTypeMini.Primary;
@@ -210,7 +210,7 @@ namespace Demo.Controls
divider2.Dock = DockStyle.Top;
divider2.Font = new Font("Microsoft YaHei UI", 10F);
divider2.LocalizationText = "Dropdown.{id}";
divider2.Location = new Point(0, 101);
divider2.Location = new Point(0, 80);
divider2.Name = "divider2";
divider2.Orientation = AntdUI.TOrientation.Left;
divider2.Size = new Size(1300, 28);
@@ -226,7 +226,7 @@ namespace Demo.Controls
panel4.Dock = DockStyle.Top;
panel4.Location = new Point(0, 28);
panel4.Name = "panel4";
panel4.Size = new Size(1300, 73);
panel4.Size = new Size(1300, 52);
panel4.TabIndex = 2;
//
// button17
@@ -237,7 +237,7 @@ namespace Demo.Controls
button17.Location = new Point(3, 3);
button17.Name = "button17";
button17.ShowArrow = true;
button17.Size = new Size(120, 47);
button17.Size = new Size(113, 46);
button17.TabIndex = 0;
button17.Text = "Click me";
button17.Type = AntdUI.TTypeMini.Primary;
@@ -247,10 +247,10 @@ namespace Demo.Controls
button19.AutoSizeMode = AntdUI.TAutoSize.Auto;
button19.Items.AddRange(new object[] { "菜单1", "菜单2", "菜单3" });
button19.ListAutoWidth = false;
button19.Location = new Point(129, 3);
button19.Location = new Point(122, 3);
button19.Name = "button19";
button19.ShowArrow = true;
button19.Size = new Size(130, 47);
button19.Size = new Size(123, 46);
button19.TabIndex = 0;
button19.Text = "Hover me";
button19.Trigger = AntdUI.Trigger.Hover;
@@ -259,9 +259,9 @@ namespace Demo.Controls
//
dropdown1.AutoSizeMode = AntdUI.TAutoSize.Auto;
dropdown1.LocalizationText = "Dropdown.{id}";
dropdown1.Location = new Point(265, 3);
dropdown1.Location = new Point(251, 3);
dropdown1.Name = "dropdown1";
dropdown1.Size = new Size(100, 47);
dropdown1.Size = new Size(93, 46);
dropdown1.TabIndex = 0;
dropdown1.Text = "多级菜单";
dropdown1.Type = AntdUI.TTypeMini.Primary;

View File

@@ -107,9 +107,9 @@ namespace Demo.Controls
panel4.Controls.Add(panel5);
panel4.Controls.Add(radio9);
panel4.Dock = DockStyle.Top;
panel4.Location = new Point(0, 184);
panel4.Location = new Point(0, 180);
panel4.Name = "panel4";
panel4.Size = new Size(650, 96);
panel4.Size = new Size(650, 90);
panel4.TabIndex = 3;
//
// panel5
@@ -126,9 +126,9 @@ namespace Demo.Controls
//
button2.AutoSizeMode = AntdUI.TAutoSize.Width;
button2.Dock = DockStyle.Left;
button2.Location = new Point(83, 0);
button2.Location = new Point(74, 0);
button2.Name = "button2";
button2.Size = new Size(76, 38);
button2.Size = new Size(67, 38);
button2.TabIndex = 1;
button2.Text = "Disable";
button2.Type = AntdUI.TTypeMini.Primary;
@@ -140,7 +140,7 @@ namespace Demo.Controls
button1.Dock = DockStyle.Left;
button1.Location = new Point(0, 0);
button1.Name = "button1";
button1.Size = new Size(83, 38);
button1.Size = new Size(74, 38);
button1.TabIndex = 0;
button1.Text = "Uncheck";
button1.Type = AntdUI.TTypeMini.Primary;
@@ -152,7 +152,7 @@ namespace Demo.Controls
radio9.Checked = true;
radio9.Location = new Point(0, 0);
radio9.Name = "radio9";
radio9.Size = new Size(187, 43);
radio9.Size = new Size(176, 42);
radio9.TabIndex = 0;
radio9.Text = "Checked-Enabled";
radio9.CheckedChanged += radio9_CheckedChanged;
@@ -163,7 +163,7 @@ namespace Demo.Controls
divider3.Dock = DockStyle.Top;
divider3.Font = new Font("Microsoft YaHei UI", 10F);
divider3.LocalizationText = "Radio.{id}";
divider3.Location = new Point(0, 156);
divider3.Location = new Point(0, 152);
divider3.Name = "divider3";
divider3.Orientation = AntdUI.TOrientation.Left;
divider3.Size = new Size(650, 28);
@@ -177,9 +177,9 @@ namespace Demo.Controls
panel3.Controls.Add(radio6);
panel3.Controls.Add(radio5);
panel3.Dock = DockStyle.Top;
panel3.Location = new Point(0, 106);
panel3.Location = new Point(0, 104);
panel3.Name = "panel3";
panel3.Size = new Size(650, 50);
panel3.Size = new Size(650, 48);
panel3.TabIndex = 2;
//
// radio8
@@ -189,9 +189,9 @@ namespace Demo.Controls
radio8.Dock = DockStyle.Left;
radio8.Enabled = false;
radio8.Fill = Color.FromArgb(100, 0, 0);
radio8.Location = new Point(359, 0);
radio8.Location = new Point(334, 0);
radio8.Name = "radio8";
radio8.Size = new Size(121, 50);
radio8.Size = new Size(113, 48);
radio8.TabIndex = 3;
radio8.Text = "Option D";
//
@@ -200,9 +200,9 @@ namespace Demo.Controls
radio7.AutoSizeMode = AntdUI.TAutoSize.Width;
radio7.Dock = DockStyle.Left;
radio7.Fill = Color.FromArgb(150, 0, 0);
radio7.Location = new Point(239, 0);
radio7.Location = new Point(223, 0);
radio7.Name = "radio7";
radio7.Size = new Size(120, 50);
radio7.Size = new Size(111, 48);
radio7.TabIndex = 2;
radio7.Text = "Option C";
//
@@ -211,9 +211,9 @@ namespace Demo.Controls
radio6.AutoSizeMode = AntdUI.TAutoSize.Width;
radio6.Dock = DockStyle.Left;
radio6.Fill = Color.FromArgb(200, 0, 0);
radio6.Location = new Point(120, 0);
radio6.Location = new Point(112, 0);
radio6.Name = "radio6";
radio6.Size = new Size(119, 50);
radio6.Size = new Size(111, 48);
radio6.TabIndex = 1;
radio6.Text = "Option B";
//
@@ -224,7 +224,7 @@ namespace Demo.Controls
radio5.Fill = Color.FromArgb(250, 0, 0);
radio5.Location = new Point(0, 0);
radio5.Name = "radio5";
radio5.Size = new Size(120, 50);
radio5.Size = new Size(112, 48);
radio5.TabIndex = 0;
radio5.Text = "Option A";
//
@@ -233,7 +233,7 @@ namespace Demo.Controls
divider2.Dock = DockStyle.Top;
divider2.Font = new Font("Microsoft YaHei UI", 10F);
divider2.LocalizationText = "Radio.{id}";
divider2.Location = new Point(0, 78);
divider2.Location = new Point(0, 76);
divider2.Name = "divider2";
divider2.Orientation = AntdUI.TOrientation.Left;
divider2.Size = new Size(650, 28);
@@ -249,7 +249,7 @@ namespace Demo.Controls
panel2.Dock = DockStyle.Top;
panel2.Location = new Point(0, 28);
panel2.Name = "panel2";
panel2.Size = new Size(650, 50);
panel2.Size = new Size(650, 48);
panel2.TabIndex = 1;
//
// radio4
@@ -257,9 +257,9 @@ namespace Demo.Controls
radio4.AutoSizeMode = AntdUI.TAutoSize.Width;
radio4.Dock = DockStyle.Left;
radio4.Enabled = false;
radio4.Location = new Point(354, 0);
radio4.Location = new Point(330, 0);
radio4.Name = "radio4";
radio4.Size = new Size(118, 50);
radio4.Size = new Size(110, 48);
radio4.TabIndex = 3;
radio4.Text = "Option 4";
//
@@ -267,9 +267,9 @@ namespace Demo.Controls
//
radio3.AutoSizeMode = AntdUI.TAutoSize.Width;
radio3.Dock = DockStyle.Left;
radio3.Location = new Point(236, 0);
radio3.Location = new Point(220, 0);
radio3.Name = "radio3";
radio3.Size = new Size(118, 50);
radio3.Size = new Size(110, 48);
radio3.TabIndex = 2;
radio3.Text = "Option 3";
//
@@ -277,9 +277,9 @@ namespace Demo.Controls
//
radio2.AutoSizeMode = AntdUI.TAutoSize.Width;
radio2.Dock = DockStyle.Left;
radio2.Location = new Point(118, 0);
radio2.Location = new Point(110, 0);
radio2.Name = "radio2";
radio2.Size = new Size(118, 50);
radio2.Size = new Size(110, 48);
radio2.TabIndex = 1;
radio2.Text = "Option 2";
//
@@ -289,7 +289,7 @@ namespace Demo.Controls
radio1.Dock = DockStyle.Left;
radio1.Location = new Point(0, 0);
radio1.Name = "radio1";
radio1.Size = new Size(118, 50);
radio1.Size = new Size(110, 48);
radio1.TabIndex = 0;
radio1.Text = "Option 1";
//

View File

@@ -358,7 +358,6 @@ namespace AntdUI
#region
bool textLine = false;
string? text;
/// <summary>
/// 文本
@@ -373,8 +372,6 @@ namespace AntdUI
if (string.IsNullOrEmpty(value)) value = null;
if (text == value) return;
text = value;
if (text == null) textLine = false;
else textLine = text.Contains(Environment.NewLine);
if (BeforeAutoSize()) Invalidate();
OnTextChanged(EventArgs.Empty);
OnPropertyChanged(nameof(Text));
@@ -1517,6 +1514,30 @@ namespace AntdUI
}
}
}
Size MeasureText(Canvas g, string? text, Rectangle rect, out int txt_height, out bool multiLine)
{
var font_height = g.MeasureText(Config.NullText, Font);
txt_height = font_height.Height;
multiLine = false;
if (text == null) return font_height;
else
{
var font_size = g.MeasureText(text, Font);
if (font_size.Width > rect.Width && (textMultiLine || text.Contains("\n")))
{
multiLine = true;
return g.MeasureText(text, Font, rect.Width);
}
else return font_size;
}
}
Size MeasureText(Canvas g, string? text, out int txt_height)
{
var font_height = g.MeasureText(Config.NullText, Font);
txt_height = font_height.Height;
if (text == null) return font_height;
else return g.MeasureText(text, Font);
}
void PaintTextLoading(Canvas g, string? text, Color color, Rectangle rect_read, bool enabled, float radius)
{
if (enabled && hasFocus && WaveSize > 0)
@@ -1529,7 +1550,7 @@ namespace AntdUI
}
}
bool has_loading = loading && LoadingValue > -1;
var font_size = g.MeasureText(text ?? Config.NullText, Font);
var font_size = MeasureText(g, text, rect_read, out int txt_height, out bool textLine);
if (virtualWidth.HasValue) font_size.Width = virtualWidth.Value;
if (text == null || displayStyle == TButtonDisplayStyle.Image)
{
@@ -1565,7 +1586,7 @@ namespace AntdUI
{
if (has_left && has_right)
{
rect_text = RectAlignLR(g, textLine, textMultiLine, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_l, out var rect_r);
rect_text = RectAlignLR(g, txt_height, textLine, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_l, out var rect_r);
if (has_loading)
{
@@ -1582,7 +1603,7 @@ namespace AntdUI
}
else if (has_left)
{
rect_text = RectAlignL(g, textLine, textMultiLine, textCenterHasIcon, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_l);
rect_text = RectAlignL(g, txt_height, textLine, textCenterHasIcon, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_l);
if (has_loading)
{
float loading_size = rect_l.Height * .14F;
@@ -1596,7 +1617,7 @@ namespace AntdUI
}
else
{
rect_text = RectAlignR(g, textLine, textMultiLine, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_r);
rect_text = RectAlignR(g, txt_height, textLine, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_r);
PaintTextArrow(g, rect_r, color);
}
@@ -1612,7 +1633,7 @@ namespace AntdUI
{
if (has_loading)
{
rect_text = RectAlignL(g, textLine, textMultiLine, textCenterHasIcon, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_l);
rect_text = RectAlignL(g, txt_height, textLine, textCenterHasIcon, Font, iconPosition, iconratio, icongap, font_size, rect_read, out var rect_l);
float loading_size = rect_l.Height * .14F;
using (var brush = new Pen(color, loading_size))
{
@@ -1648,12 +1669,10 @@ namespace AntdUI
}
}
internal static Rectangle RectAlignL(Canvas g, bool textLine, bool textMultiLine, bool textCenter, Font font, TAlignMini iconPosition, float iconratio, float icongap, Size font_size, Rectangle rect_read, out Rectangle rect_l)
internal static Rectangle RectAlignL(Canvas g, int font_Height, bool multiLine, bool textCenter, Font font, TAlignMini iconPosition, float iconratio, float icongap, Size font_size, Rectangle rect_read, out Rectangle rect_l)
{
int font_Height = font_size.Height;
if (textLine && (iconPosition == TAlignMini.Top || iconPosition == TAlignMini.Bottom)) font_Height = g.MeasureString(Config.NullText, font).Height;
int icon_size = (int)(font_Height * iconratio), sp = (int)(font_Height * icongap);
if (textMultiLine && (iconPosition == TAlignMini.Left || iconPosition == TAlignMini.Right))
if (multiLine && (iconPosition == TAlignMini.Left || iconPosition == TAlignMini.Right))
{
int rw = icon_size + sp;
if (font_size.Width + rw > rect_read.Width) font_size.Width = rect_read.Width - rw;
@@ -1715,12 +1734,10 @@ namespace AntdUI
}
return rect_text;
}
internal static Rectangle RectAlignLR(Canvas g, bool textLine, bool textMultiLine, Font font, TAlignMini iconPosition, float iconratio, float icongap, Size font_size, Rectangle rect_read, out Rectangle rect_l, out Rectangle rect_r)
internal static Rectangle RectAlignLR(Canvas g, int font_Height, bool multiLine, Font font, TAlignMini iconPosition, float iconratio, float icongap, Size font_size, Rectangle rect_read, out Rectangle rect_l, out Rectangle rect_r)
{
int font_Height = font_size.Height;
if (textLine && (iconPosition == TAlignMini.Top || iconPosition == TAlignMini.Bottom)) font_Height = g.MeasureString(Config.NullText, font).Height;
int icon_size = (int)(font_Height * iconratio), sp = (int)(font_Height * icongap), sps = (int)(font_size.Height * .4F);
if (textMultiLine && (iconPosition == TAlignMini.Left || iconPosition == TAlignMini.Right))
if (multiLine && (iconPosition == TAlignMini.Left || iconPosition == TAlignMini.Right))
{
int rw = (icon_size + sp) * 2;
if (font_size.Width + rw > rect_read.Width) font_size.Width = rect_read.Width - rw;
@@ -1756,12 +1773,10 @@ namespace AntdUI
}
return rect_text;
}
internal static Rectangle RectAlignR(Canvas g, bool textLine, bool textMultiLine, Font font, TAlignMini iconPosition, float iconratio, float icongap, Size font_size, Rectangle rect_read, out Rectangle rect_r)
internal static Rectangle RectAlignR(Canvas g, int font_Height, bool multiLine, Font font, TAlignMini iconPosition, float iconratio, float icongap, Size font_size, Rectangle rect_read, out Rectangle rect_r)
{
int font_Height = font_size.Height;
if (textLine && (iconPosition == TAlignMini.Top || iconPosition == TAlignMini.Bottom)) font_Height = g.MeasureString(Config.NullText, font).Height;
int icon_size = (int)(font_Height * iconratio), sp = (int)(font_Height * icongap), sps = (int)(font_size.Height * .4F), rsps = icon_size + sp;
if (textMultiLine && (iconPosition == TAlignMini.Left || iconPosition == TAlignMini.Right))
if (multiLine && (iconPosition == TAlignMini.Left || iconPosition == TAlignMini.Right))
{
int rw = icon_size + sp;
if (font_size.Width + rw > rect_read.Width) font_size.Width = rect_read.Width - rw;
@@ -2226,32 +2241,40 @@ namespace AntdUI
{
return Helper.GDI(g =>
{
var font_size = g.MeasureText(Text ?? Config.NullText, Font);
int gap = (int)(20 * Config.Dpi), wave = (int)(WaveSize * Config.Dpi);
var font_size = MeasureText(g, Text, out int txt_height);
int icon_size = (int)(txt_height * iconratio), gap = (int)(txt_height * 1.02F), wave = (int)(WaveSize * Config.Dpi), wave2 = wave;
int height = Math.Max(font_size.Height, icon_size);
if (Shape == TShape.Circle || string.IsNullOrEmpty(Text) || displayStyle == TButtonDisplayStyle.Image)
{
int s = font_size.Height + wave + gap;
int s = height + wave + gap;
return new Size(s, s);
}
else
{
int m = wave * 2;
if (joinMode > 0) m = 0;
else if (joinLeft || joinRight) m = 0;
bool show_icon = displayStyle == TButtonDisplayStyle.Default, has_icon = (loading && LoadingValue > -1) || (HasIcon && show_icon);
if (has_icon || showArrow)
if (joinMode > 0) wave2 = 0;
else if (joinLeft || joinRight) wave2 = 0;
bool has_icon = (loading && LoadingValue > -1) || (HasIcon && displayStyle == TButtonDisplayStyle.Default);
if (has_icon && showArrow)
{
if (has_icon && (IconPosition == TAlignMini.Top || IconPosition == TAlignMini.Bottom))
{
int size = (int)Math.Ceiling(font_size.Height * 1.2F);
return new Size(font_size.Width + m + gap + size, font_size.Height + wave + gap + size);
}
int height = font_size.Height + wave + gap;
if (has_icon && showArrow) return new Size(font_size.Width + m + gap + font_size.Height * 2, height);
else if (has_icon) return new Size(font_size.Width + m + gap + (int)Math.Ceiling(font_size.Height * 1.2F), height);
else return new Size(font_size.Width + m + gap + (int)Math.Ceiling(font_size.Height * .8F), height);
int sp = (int)(txt_height * icongap);
int y = gap + wave, x = y + wave2 + (icon_size + sp) * 2;
if (IconPosition == TAlignMini.Top || IconPosition == TAlignMini.Bottom) return new Size(font_size.Width + y, font_size.Height + x);
else return new Size(font_size.Width + x, height + y);
}
else return new Size(font_size.Width + m + gap, font_size.Height + wave + gap);
else if (has_icon)
{
int sp = (int)(txt_height * icongap);
int y = gap + wave, x = y + wave2 + icon_size + sp;
if (IconPosition == TAlignMini.Top || IconPosition == TAlignMini.Bottom) return new Size(font_size.Width + y, font_size.Height + x);
else return new Size(font_size.Width + x, height + y);
}
else if (showArrow)
{
int sp = (int)(txt_height * icongap);
int y = gap + wave, x = y + wave2 + icon_size + sp;
return new Size(font_size.Width + x, height + y);
}
return new Size(font_size.Width + gap + wave + wave2, height + gap + wave);
}
});
}

View File

@@ -465,17 +465,10 @@ namespace AntdUI
{
return Helper.GDI(g =>
{
int gap = (int)(20 * Config.Dpi);
if (string.IsNullOrWhiteSpace(Text))
{
var font_size = g.MeasureString(Config.NullText, Font);
return new Size(font_size.Height + gap, font_size.Height + gap);
}
else
{
var font_size = g.MeasureText(Text, Font);
return new Size(font_size.Width + font_size.Height + gap, font_size.Height + gap);
}
var font_size = g.MeasureString(Config.NullText, Font);
int gap = (int)(font_size.Height * 1.02F);
if (string.IsNullOrWhiteSpace(Text)) return new Size(font_size.Height + gap, font_size.Height + gap);
else return new Size(g.MeasureText(Text, Font).Width + font_size.Height + gap, font_size.Height + gap);
});
}
}

View File

@@ -968,7 +968,7 @@ namespace AntdUI
else font_size = g.MeasureString("Transparent", Font);
}
else font_size = g.MeasureString(ValueFormatChanged(this, new ColorEventArgs(_value)), Font);
int gap = (int)((20 + WaveSize) * Config.Dpi);
int gap = (int)(font_size.Height * 1.02F) + (int)(WaveSize * Config.Dpi);
if (showText)
{
int s = font_size.Height + gap;

View File

@@ -30,6 +30,7 @@ namespace AntdUI
/// <summary>
/// DatePicker 日期选择框
/// </summary>
/// <seealso cref="Input"/>
/// <remarks>输入或选择日期的控件。</remarks>
[Description("DatePicker 日期选择框")]
[ToolboxItem(true)]

View File

@@ -29,6 +29,7 @@ namespace AntdUI
/// <summary>
/// DatePickerRange 日期范围选择框
/// </summary>
/// <seealso cref="Input"/>
/// <remarks>输入或选择日期范围的控件。</remarks>
[Description("DatePickerRange 日期范围选择框")]
[ToolboxItem(true)]

View File

@@ -29,6 +29,7 @@ namespace AntdUI
/// <summary>
/// Dropdown 选择器
/// </summary>
/// <seealso cref="Button"/>
/// <remarks>向下弹出的列表。</remarks>
[Description("Dropdown 下拉菜单")]
[ToolboxItem(true)]

View File

@@ -28,6 +28,7 @@ namespace AntdUI
/// <summary>
/// InputNumber 数字输入框
/// </summary>
/// <seealso cref="Input"/>
/// <remarks>通过鼠标或键盘,输入范围内的数值。</remarks>
[Description("InputNumber 数字输入框")]
[ToolboxItem(true)]

View File

@@ -484,17 +484,10 @@ namespace AntdUI
{
return Helper.GDI(g =>
{
int gap = (int)(20 * Config.Dpi);
if (string.IsNullOrWhiteSpace(Text))
{
var font_size = g.MeasureString(Config.NullText, Font);
return new Size(font_size.Height + gap, font_size.Height + gap);
}
else
{
var font_size = g.MeasureText(Text, Font);
return new Size(font_size.Width + font_size.Height + gap, font_size.Height + gap);
}
var font_size = g.MeasureString(Config.NullText, Font);
int gap = (int)(font_size.Height * 1.02F);
if (string.IsNullOrWhiteSpace(Text)) return new Size(font_size.Height + gap, font_size.Height + gap);
else return new Size(g.MeasureText(Text, Font).Width + font_size.Height + gap, font_size.Height + gap);
});
}
}

View File

@@ -30,6 +30,7 @@ namespace AntdUI
/// <summary>
/// Select 选择器
/// </summary>
/// <seealso cref="Input"/>
/// <remarks>下拉选择器。</remarks>
[Description("Select 选择器")]
[ToolboxItem(true)]

View File

@@ -31,6 +31,7 @@ namespace AntdUI
/// <summary>
/// Select 多选器
/// </summary>
/// <seealso cref="Input"/>
/// <remarks>下拉多选器。</remarks>
[Description("Select 多选器")]
[ToolboxItem(true)]

View File

@@ -28,6 +28,7 @@ namespace AntdUI
/// <summary>
/// SliderRange 滑动范围输入条
/// </summary>
/// <seealso cref="Slider"/>
/// <remarks>滑动型范围输入器。</remarks>
[Description("SliderRange 滑动范围输入条")]
[ToolboxItem(true)]

View File

@@ -28,6 +28,7 @@ namespace AntdUI
/// <summary>
/// Splitter 分隔面板
/// </summary>
/// <seealso cref="SplitContainer"/>
/// <remarks>自由切分指定区域。</remarks>
[Description("Splitter 分隔面板")]
[ToolboxItem(true)]

View File

@@ -30,6 +30,7 @@ namespace AntdUI
/// <summary>
/// TabHeader 多标签页头
/// </summary>
/// <seealso cref="PageHeader"/>
[Description("TabHeader 多标签页头")]
[DefaultProperty("SelectedIndex")]
[DefaultEvent("TabChanged")]

View File

@@ -24,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 徽标
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellBadge : ICell
{
/// <summary>

View File

@@ -24,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 按钮
/// </summary>
/// <seealso cref="CellLink"/>
public partial class CellButton : CellLink
{
/// <summary>

View File

@@ -25,6 +25,7 @@ namespace AntdUI
/// <summary>
/// 复选框
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellCheckbox : ICell
{
/// <summary>

View File

@@ -22,6 +22,7 @@ namespace AntdUI
/// <summary>
/// 分割线
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellDivider : ICell
{
public override string? ToString() => null;

View File

@@ -24,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 图片
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellImage : ICell
{
/// <summary>

View File

@@ -17,7 +17,6 @@
// CSDN: https://blog.csdn.net/v_132
// QQ: 17379620
using System;
using System.Drawing;
namespace AntdUI
@@ -25,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 超链接
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellLink : ICell
{
/// <summary>
@@ -43,7 +43,6 @@ namespace AntdUI
#region
internal bool textLine = false;
string? _text;
/// <summary>
/// 文本
@@ -55,8 +54,6 @@ namespace AntdUI
{
if (_text == value) return;
_text = value;
if (_text == null) textLine = false;
else textLine = _text.Contains(Environment.NewLine);
OnPropertyChanged(true);
}
}

View File

@@ -24,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 进度条
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellProgress : ICell
{
/// <summary>

View File

@@ -25,6 +25,7 @@ namespace AntdUI
/// <summary>
/// 单选框
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellRadio : ICell
{
/// <summary>

View File

@@ -24,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 标签
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellTag : ICell
{
/// <summary>

View File

@@ -24,6 +24,7 @@ namespace AntdUI
/// <summary>
/// 文字
/// </summary>
/// <seealso cref="ICell"/>
public partial class CellText : ICell
{
/// <summary>

View File

@@ -272,6 +272,23 @@ namespace AntdUI
return rect_read.RoundPath(_radius);
}
static Size MeasureText(Canvas g, string? text, Font font, Rectangle rect, out int txt_height, out bool multiLine)
{
var font_height = g.MeasureText(Config.NullText, font);
txt_height = font_height.Height;
multiLine = false;
if (text == null) return font_height;
else
{
var font_size = g.MeasureText(text, font);
if (font_size.Width > rect.Width && text.Contains("\n"))
{
multiLine = true;
return g.MeasureText(text, font, rect.Width);
}
else return font_size;
}
}
static void PaintButton(Canvas g, Font font, CellButton btn, Color color, Rectangle rect_read)
{
if (string.IsNullOrEmpty(btn.Text))
@@ -288,25 +305,25 @@ namespace AntdUI
}
else
{
var font_size = g.MeasureText(btn.Text ?? Config.NullText, font);
var font_size = MeasureText(g, btn.Text, font, rect_read, out int txt_height, out bool textLine);
bool has_left = btn.HasIcon, has_right = btn.ShowArrow;
Rectangle rect_text;
if (has_left || has_right)
{
if (has_left && has_right)
{
rect_text = Button.RectAlignLR(g, btn.textLine, false, font, btn.IconPosition, btn.IconRatio, btn.IconGap, font_size, rect_read, out var rect_l, out var rect_r);
rect_text = Button.RectAlignLR(g, txt_height, textLine, font, btn.IconPosition, btn.IconRatio, btn.IconGap, font_size, rect_read, out var rect_l, out var rect_r);
PaintButtonPaintImage(g, btn, color, rect_l);
PaintButtonTextArrow(g, btn, rect_r, color);
}
else if (has_left)
{
rect_text = Button.RectAlignL(g, btn.textLine, false, false, font, btn.IconPosition, btn.IconRatio, btn.IconGap, font_size, rect_read, out var rect_l);
rect_text = Button.RectAlignL(g, txt_height, textLine, false, font, btn.IconPosition, btn.IconRatio, btn.IconGap, font_size, rect_read, out var rect_l);
PaintButtonPaintImage(g, btn, color, rect_l);
}
else
{
rect_text = Button.RectAlignR(g, btn.textLine, false, font, btn.IconPosition, btn.IconRatio, btn.IconGap, font_size, rect_read, out var rect_r);
rect_text = Button.RectAlignR(g, txt_height, textLine, font, btn.IconPosition, btn.IconRatio, btn.IconGap, font_size, rect_read, out var rect_r);
PaintButtonTextArrow(g, btn, rect_r, color);
}
}

View File

@@ -28,6 +28,7 @@ namespace AntdUI
/// <summary>
/// TimePicker 时间选择框
/// </summary>
/// <seealso cref="Input"/>
/// <remarks>输入或选择时间的控件。</remarks>
[Description("TimePicker 时间选择框")]
[ToolboxItem(true)]

View File

@@ -35,6 +35,7 @@ namespace AntdUI
[Description("Transfer 穿梭框")]
[ToolboxItem(true)]
[DefaultEvent("TransferChanged")]
[Obsolete("[beta] Incomplete functionality, does not support DPI")]
public class Transfer : IControl
{
#region