c++builder的使用

来源:百度知道 编辑:UC知道 时间:2024/05/16 14:06:50
Label怎么显示时间。。

加一个时间控件.
然后在TFORM双击.创建FORMCREATE事件
Label1->Caption=Time();

SYSTEMTIME curTime;//定义一时间变量
AnsiString nowTime;//定义时间字符串
GetLocalTime(&curTime);//获取系统时间

nowTime=IntToStr(curTime.wHour)+":"+IntToStr(curTime.wMinute)+":"+IntToStr(curTime.wSecond);//拼接

Label1->Caption = nowTime;//显示