GridPanel容器添加控件顺序调整

This commit is contained in:
czz_y 2024-12-31 08:33:11 +08:00
parent 10a90cf6cd
commit 5a098a108b

View File

@ -46,15 +46,17 @@ namespace AntdUIDemo.Views
gridPanel.Span = spantext; gridPanel.Span = spantext;
gridPanel.Gap = (int)gap; gridPanel.Gap = (int)gap;
string[] array = spantext.Split(';', ' ', '\n'); string[] array = spantext.Split(';', ' ', '\n');
for (int i = 0; i < array.Length; i++) for (int i = 1; i < array.Length + 1; i++)
{ {
gridPanel.Controls.Add(new AntdUI.Button() var control = new AntdUI.Button()
{ {
Text = "Button", Text = "Button" + i,
Type = TTypeMini.Primary, Type = TTypeMini.Primary,
WaveSize = 0, WaveSize = 0,
Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))), Font = new Font("Microsoft YaHei UI", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(134))),
}); };
gridPanel.Controls.Add(control);
control.BringToFront();
} }
} }