面对现实,超越自己
逆水行舟,不进则退
posts - 269,comments - 32,trackbacks - 0
示例:
    CRect rc = CRect(0,0,0,0);
    m_staticTime.GetClientRect(&rc);

    CDC* pDC = m_staticTime.GetDC();
    TEXTMETRIC tm;
    pDC->GetTextMetrics(&tm);
    int nFontHeight  = tm.tmHeight + tm.tmExternalLeading;
    int nTopBottom  = (rc.Height() - nFontHeight) / 2;
    int nLeftRight     = (rc.Width()  - nFontHeight) / 2;

    rc.DeflateRect(nLeftRight, nTopBottom);
    m_staticTime.SetRectNP(&rc);
    m_staticTime.SetWindowText("45");

    ReleaseDC(pDC);
posted on 2013-09-04 16:14 王海光 阅读(2578) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理