跳到主要内容

UiOptions

窗口类 UI 的共享选项(标题、位置、置顶、焦点、字体、输入法、自动关闭等);各方法只使用其支持的字段(见方法说明),其余忽略。

构造​

UiOptions(string? Title = null, string? Help = null, string Position = "mouse", Rect? Bounds = null, bool Topmost = true, bool RestoreFocus = true, bool CloseOnBlur = false, bool NoFocus = false, int FontSize = 0, string? Font = null, string? Ime = null, int AutoCloseMs = 0, string? Key = null)

属性​

属性类型说明
Titlestring?窗口标题;缺省为动作标题。
Helpstring?帮助说明(Markdown,显示在窗口的帮助入口);不支持图片与 HTML 标签。Select/Prompt/PromptDate/Form 使用。
Positionstring窗口位置:mouse|mouse2|center|topLeft|topCenter|topRight|leftCenter|rightCenter|bottomLeft|bottomCenter|bottomRight|last;last 仅 Select/SelectMany 支持,其余降级为 mouse;Alert/Confirm/Ask 与文件对话框忽略。
BoundsRect?指定窗口矩形(物理像素),优先于 Position;Select/SelectMany/Form/ShowText 支持,Prompt/PromptNumber/PromptDate 降级为 mouse,Alert/Confirm/Ask 与文件对话框忽略。
Topmostbool是否置顶。
RestoreFocusbool关闭后是否恢复原前台窗口。
CloseOnBlurbool失去焦点时自动关闭:Select/Prompt/PromptDate 视为取消(返回 null);ShowText 照常返回关闭时的结果。
NoFocusbool显示时不抢键盘焦点。
FontSizeint字号;0 为默认。
Fontstring?字体名称(如 微软雅黑);不能包含 / \ : #。
Imestring?输入法:on|off;null 为不切换。
AutoCloseMsint自动关闭时长(毫秒;0 为不自动关闭;窗口按整秒计时,不足 1 秒向上取整)。仅 Select/SelectMany/ShowImage 使用。
Keystring?窗口标识:再次显示同 Key 窗口时,关闭本动作仍打开的旧窗口并沿用其位置(仅 Select/SelectMany/ShowText 使用);按动作隔离,位置不持久化。