m_nWidth+=5; //defined in class CClientDC dc(this); TEXTMETRIC tm; dc.GetTextMetrics(&tm); CRect rect; rect.left=0; rect.top=200; rect.right=m_nWidth; rect.bottom=rect.top+tm.tmHeight; dc.SetTextColor(RGB(0,255,0)); dc.SetBkColor(RGB(240,240,240)); CString str; str.LoadString(IDS_STRING); rect.top=150; rect.bottom=rect.top+tm.tmHeight; dc.DrawText(str,rect,DT_RIGHT); CSize sz=dc.GetTextExtent(str); if(m_nWidth==sz.cx) { m_nWidth-=5; a--; if(a==-tm.tmHeight) a=150; rect.top=a; rect.bottom=a+tm.tmHeight; dc.DrawText(str,rect,DT_BOTTOM|DT_SINGLELINE); } CDialog::OnTimer(nIDEvent);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)