Files
AntdUI/doc/wiki/zh/Control/Modal.md
2025-03-12 17:32:44 +08:00

2.4 KiB

首页更新日志配置主题

Modal

Modal 对话框

模态对话框。

Modal.Config

配置对话框

名称 描述 类型 默认值
Form 所属窗口 Form? 为空无法使用Mask
Title 标题 string 必填
Content 控件/内容 object 必填
Width 消息框宽度 int 416
Font 字体 Font? null
Icon 图标 TType None
Keyboard 是否支持键盘 esc 关闭 bool true
Mask 是否展示遮罩 bool true
MaskClosable 点击蒙层是否允许关闭 bool true
CloseIcon 是否显示关闭图标 bool false
Tag 用户定义数据 object? null
Padding 边距 Size 24, 20
BtnHeight 按钮栏高度 int 38
CancelText 取消按钮文字 string "取消"
CancelFont 取消按钮字体 Font? null
OkText 确认按钮文字 string "确定"
OkType 确认按钮类型 TTypeMini Primary
OkFont 确认按钮字体 Font? null
OnOk 确定回调 Func<Config, bool>? null
Btns 自定义按钮 Btn[] null
OnBtns 自定义按钮回调 Action<Button> null
OnButtonStyle 自定义按钮样式回调 Action<string, Button> null
LoadingDisableCancel 加载时禁用取消按钮 bool false
Draggable 拖拽窗口 bool true
Close() 主动关闭 void

Modal.Btn

配置自定义按钮

名称 描述 类型 默认值
Name 按钮名称 string 必填
Text 按钮文字 string 必填
Type 按钮类型 TTypeMini Default
Fore 文字颜色 Color? null
Back 背景颜色 Color? null
Tag 用户定义数据 object? null

UserControl 监控 Load 示例

public partial class UserControl1 : UserControl, AntdUI.ControlEvent
{
    public void LoadCompleted()
    {
        System.Diagnostics.Debug.WriteLine("Load");
    }

    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
        System.Diagnostics.Debug.WriteLine("Close");
    }
}