在evc中,改变CStatic中的文字,
CStatic m_BG;
m_GB.Create();
m_GB.SetWindowsText();
以上三步就可以实现了。
其中具体的代码:
BOOL CMach::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetHandle(this->GetSafeHwnd());
time = 60;
SetTimer(1,1000,NULL);
CString cs;
cs.LoadString(IDS_CONNECTING+time);
m_BG.Create(cs, WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(10,10,150,50), this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMach::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
time--;
CString str,tmp;
str.LoadString(IDS_CONNECTING);
tmp.Format(_T("%d"),time);
str+=tmp;
m_BG.SetWindowText(str);
CDialog::OnTimer(nIDEvent);
}