上传者: xjm199
|
上传时间: 2021-12-07 15:26:37
|
文件大小: 2.24MB
|
文件类型: -
更多精彩:http://blog.csdn.net/xjm199
m_nWidth+=5;
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(255,0,0));
CString str;
str.LoadString(IDS_STRINGVC);
dc.DrawText(str,rect,DT_LEFT);
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=0;
dc.SetTextColor(RGB(0,255,0));
dc.TextOut(0,200,str);
}