Static长度随文字变化

<textarea cols="50" rows="15" name="code" class="cpp">m_sTips.SetWindowText(m_curTipItem.name.c_str()); CRect rcTips; m_sTips.GetWindowRect(rcTips); ScreenToClient(&amp;rcTips); InvalidateRect(rcTips); CClientDC dc(m_sTips.m_hWnd); SIZE size; ::GetTextExtentPoint32(dc, m_curTipItem.name.c_str(), (int)m_curTipItem.name.size(), &amp;size); m_sTips.SetWindowPos(NULL, 0, 0, size.cx, size.cy, SWP_NOZORDER|SWP_NOMOVE|SWP_SHOWWINDOW|SWP_NOACTIVATE);</textarea> 

你可能感兴趣的:(Static长度随文字变化)