mthoutai

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

在dlg.h中public

bool flag;

在构造函数中

flag=false;

在button的生成函数中

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;


}

posted on 2017-08-20 21:30  mthoutai  阅读(493)  评论(0编辑  收藏  举报