• <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學習筆記
            欧美亚洲色综久久精品国产| 国产亚洲精午夜久久久久久| 99久久精品费精品国产| 久久国产亚洲精品麻豆| 久久久久久狠狠丁香| 久久精品国产只有精品66 | 色婷婷久久综合中文久久蜜桃av| 中文字幕久久亚洲一区| 色偷偷88888欧美精品久久久| 91精品国产高清久久久久久io| 国产精品久久影院| 久久久久国产一区二区三区| 欧美日韩久久中文字幕| 国产精品久久久久影院嫩草| 久久久久亚洲AV成人网人人软件| 中文字幕亚洲综合久久菠萝蜜 | 亚洲精品无码成人片久久| 久久夜色tv网站| 久久偷看各类wc女厕嘘嘘| 人妻无码精品久久亚瑟影视| 婷婷久久香蕉五月综合加勒比| 国产高潮国产高潮久久久91| 伊人久久综合无码成人网| 久久精品无码av| 久久99精品国产麻豆 | 久久久久亚洲精品日久生情| 久久婷婷久久一区二区三区| 国产毛片欧美毛片久久久| 国产香蕉97碰碰久久人人| 久久久久高潮毛片免费全部播放| 久久久久久国产精品无码下载 | 亚洲国产精品久久久久| 狼狼综合久久久久综合网| 亚洲欧洲久久av| 久久久国产精品| 久久久WWW免费人成精品| 亚洲国产精品一区二区久久| 精品一区二区久久| 九九99精品久久久久久| 国产精品久久久久久久久| 国产亚洲综合久久系列|