• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆-59  評論-36  文章-0  trackbacks-0
            前提假定,對話框上有一個ID為IDC_TEST的控件。

            在OnInitDialog函數中插入一下代碼:
            m_font.CreatePointFont(909,_T("宋體"));
            GetDlgItem(IDC_TEST)
            ->SetFont(&m_font);
            編譯后便可看見效果

            說明:
            在我第一次嘗試更改控件變量的字體時,使用了如下的代碼:
            CFont font
            font.CreatePointFont(
            909,_T("宋體"));
            GetDlgItem(IDC_TEST)
            ->SetFont(&font);

            結果,控件的字體并沒有改變。后來得知SetFont函數有如下要求:
            The SetFont() member function of the CWnd class changes the font in a specified control. For this function to work correctly in a Windows- based application, you must ensure that the CFont object specified in the SetFont() call is not destroyed until after the specified control has been destroyed.

            其中的"...you must ensure that the CFont object specified in the SetFont() call is not destroyed until after the specified control has been destroyed. "便是關鍵。
            所以在更該控件的字體時,CFont對象必須是靜態或者成員變量。
            posted on 2009-12-30 22:05 zhaoyg 閱讀(534) 評論(0)  編輯 收藏 引用 所屬分類: MFC學習筆記
            亚洲精品高清久久| 99久久综合国产精品二区| 伊人久久精品影院| 色欲综合久久躁天天躁蜜桃| 久久久久久国产精品无码超碰| 欧美久久精品一级c片片| 一本久道久久综合狠狠躁AV| 久久久噜噜噜久久熟女AA片| 婷婷久久综合九色综合九七| 91精品国产综合久久久久久 | 国产V综合V亚洲欧美久久| 久久久久亚洲AV成人网| 久久久无码一区二区三区 | 伊人久久大香线焦AV综合影院| 99久久婷婷国产综合精品草原| 久久婷婷五月综合97色一本一本 | 久久嫩草影院免费看夜色| 狠狠色丁香婷婷综合久久来| 7777精品久久久大香线蕉| 青青久久精品国产免费看| 99久久亚洲综合精品成人| 狠狠狠色丁香婷婷综合久久俺| 无码AV波多野结衣久久| 波多野结衣AV无码久久一区| 久久午夜夜伦鲁鲁片免费无码影视| 国产亚洲精午夜久久久久久 | 久久综合丁香激情久久| 亚洲va中文字幕无码久久| 久久久久久久波多野结衣高潮| 久久综合九色综合久99| 色8激情欧美成人久久综合电| 久久免费视频一区| 国产精品久久久香蕉| 97精品国产97久久久久久免费| 亚洲综合熟女久久久30p| 99久久国产精品免费一区二区| 久久精品国产乱子伦| 一本久久a久久精品亚洲| 99久久99这里只有免费的精品| 久久99国产亚洲高清观看首页| 伊人久久大香线蕉精品|