Effect:
The Text Control display code
bool CIDCardCountDown: : ShowMessage ()
{
Unsigned int delaySeconds=m_countDownSeconds - m_consumeSeconds;
CRect rc;
: : GetWindowRect (m_hWnd, rc);
M_pParent - & gt; The InvalidateRect (rc);
Cstrings strFormat;
If (delaySeconds>=10)
{
StrFormat. LoadString (IDS_IDCARD_COUNT_DOWN_MSG);//show message
}
The else
{
StrFormat. LoadString (IDS_IDCARD_COUNT_DOWN_MSG_LESSTHAN10);
}
Cstrings strMsg;
StrMsg. The Format (strFormat delaySeconds);
: : SetWindowText (m_hWnd, strMsg);
//: : InvalidateRect (m_hWnd, & amp; Rc, TRUE);
If (delaySeconds==0)
{
EndCountDown ();
FireCountDownComplete ();
Return false;
}
M_consumeSeconds + +;
return true;
}
The Text Control Control code
HBRUSH CLoginDlg: : OnCtlColor (CDC * pDC, CWnd * pWnd, UINT nCtlColor)
{
HBRUSH gets=__super: : OnCtlColor (pDC, pWnd, nCtlColor);
Int nControlID=pWnd - & gt; GetDlgCtrlID ();
The switch (nControlID)
{
Case IDC_COUNT_DOWN_MSG:
PDC - & gt; SetTextColor (RGB (100100100));
//pDC - & gt; SetBkColor (RGB (255255255));
PDC - & gt; SetBkMode (TRANSPARENT);
PDC - & gt; SelectObject (& amp; M_countDownFont);
Gets=(HBRUSH) GetStockObject (NULL_BRUSH);
break;
}
Return gets;
}
CodePudding user response:
OnEraseBkgnd?CodePudding user response: