MFC 静态文本框 显示系统时间
voidCNEWDlg::OnTimer(UINTnIDEvent){//TODO:Addyourmessagehandlercodehereand/orcalldefa...
void CNEWDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnTimer(nIDEvent);
CString str;
CTime theTime = CTime::GetCurrentTime();
str.Format("%02d:%02d:%02d",theTime.GetHour(),theTime.GetMinute(),theTime.GetSecond());
SetDlgItemText(IDC_STATIC_TIME,str);
}
为什么显示不出来呢? 展开
{
// TODO: Add your message handler code here and/or call default
CDialog::OnTimer(nIDEvent);
CString str;
CTime theTime = CTime::GetCurrentTime();
str.Format("%02d:%02d:%02d",theTime.GetHour(),theTime.GetMinute(),theTime.GetSecond());
SetDlgItemText(IDC_STATIC_TIME,str);
}
为什么显示不出来呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询