aardio 文档

TimePicker 时间选择框

TimePicker 用于选择一天内的时间,例如预约时间、提醒时间、工作时段等。

最小示例

import win.ui;
import dotNet.AntdUI;
/*DSG{{*/
var winform = win.form(text="AntdUI TimePicker";right=380;bottom=160)
winform.add(
host={cls="custom";left=34;top=46;right=335;bottom=85;edge=1;z=1}
)
/*}}*/

var tp = AntdUI.TimePicker(winform.host);
tp.Format = "HH:mm:ss";
tp.PlaceholderText = "请选择时间";
tp.AllowClear = true;
tp.ShowButtonNow = true;
tp.DropDownArrow = true;
tp.ValueChanged = function(sender,e){
    winform.text = "时间已改变";
}

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

常用属性与事件

主动设置与清空

import System;

tp.Value = System.TimeSpan(9,30,0);
tp.Clear();

ValueChanged 在时间改变时触发;ClearClick 可响应用户点击清除按钮;ExpandDropChanged 可监听下拉面板展开/关闭。

注意事项

Markdown 格式