aardio 文档

GridPanel 格栅布局

AntdUI.GridPanelSpan 字符串描述行列比例和行高,适合仪表盘、卡片网格、表单区块等二维布局。

最小示例

import win.ui;
import dotNet.AntdUI;
/*DSG{{*/
var winform = win.form(text="AntdUI GridPanel";right=700;bottom=360)
winform.add(host={cls="custom";left=0;top=0;right=700;bottom=360;db=1;dl=1;dr=1;dt=1;z=1})
/*}}*/

var grid = AntdUI.GridPanel(winform.host);
grid.Span = "50% 50%;50% 50%";
grid.Gap = 12;
grid.Padding = System.Windows.Forms.Padding(20);

for(i=1;4){
    var card = AntdUI.Panel();
    card.Text = "卡片 " + i;
    card.Radius = 8;
    grid.Controls.Add(card);
}

winform.show();
win.loopMessage();

Span 写法

上游约定:

常用属性与方法

成员 说明
Span 格栅规则字符串。
Gap 行列间距。
PauseLayout 批量更新时暂停布局。
Controls.Add(control) 添加子控件。
GetIndex(control) / SetIndex(control,index) 查询或设置子控件排序。

注意事项

Markdown 格式