在dlg.h中public函數
bool flag;post
在構造函數中spa
flag=false;orm
在button的生成函數中it
if(flag)
{
flag=false;
//m_showtime.SetWindowText(_T(""));
GetDlgItem(IDC_ShowTime)->SetWindowTextW(_T("")); //IDC_ShowTime爲編輯框ID
}
else
{
CTime time = CTime::GetCurrentTime();
CString str;
str = time.Format(_T("%Y-%m-%d %H:%M:%S %A"));
//SetWindowTextW(str);//,THREAD_PRIORITY_IDLE);
GetDlgItem(IDC_ShowTime)->SetWindowTextW(str);
flag=true;
}
class