• <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 閱讀(525) 評論(0)  編輯 收藏 引用 所屬分類: MFC學習筆記
            久久综合狠狠综合久久97色| 国产精品久久久久乳精品爆| 久久精品国产亚洲AV香蕉| 久久精品国产亚洲av麻豆图片| 久久精品国产亚洲AV无码麻豆| 国产精品毛片久久久久久久| 久久久久亚洲精品天堂久久久久久 | 久久久免费精品re6| 精品久久久久久无码免费| 久久综合亚洲鲁鲁五月天| 青青草国产精品久久| 亚洲国产一成人久久精品| 办公室久久精品| 久久精品蜜芽亚洲国产AV| 亚洲另类欧美综合久久图片区| 成人综合伊人五月婷久久| 久久se精品一区二区影院| 亚洲精品乱码久久久久久蜜桃图片 | 亚洲第一极品精品无码久久| 久久久无码精品午夜| 国产精品久久久久久久久鸭| 亚洲午夜久久久久久噜噜噜| 亚洲人成网站999久久久综合| 色噜噜狠狠先锋影音久久| 国产精品美女久久久久久2018| 婷婷久久综合| 人妻精品久久久久中文字幕| 国产亚洲精久久久久久无码AV| 91精品国产色综合久久| 久久国产乱子伦免费精品| 无码久久精品国产亚洲Av影片| 久久精品国产日本波多野结衣| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 久久精品国产亚洲精品| 成人国内精品久久久久影院VR| 久久亚洲精品中文字幕三区| 久久国产精品国产自线拍免费| 粉嫩小泬无遮挡久久久久久| 狠狠色丁香久久婷婷综| 亚洲国产精品久久| 久久国产乱子伦精品免费午夜|