• <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国产精品久久99果冻传媒 | 99国内精品久久久久久久| 国产成人精品久久一区二区三区| 久久亚洲精品人成综合网| 少妇久久久久久久久久| 久久免费国产精品一区二区| 久久综合给合综合久久| 亚洲中文久久精品无码ww16 | 久久播电影网| 伊色综合久久之综合久久| 久久精品国产清高在天天线| 久久国产精品-久久精品| 日本国产精品久久| 日本强好片久久久久久AAA | 久久综合日本熟妇| 久久久国产精品福利免费 | 久久久久亚洲AV成人片| 久久久WWW免费人成精品| 麻豆一区二区99久久久久| 亚洲欧美久久久久9999| 久久婷婷国产麻豆91天堂| 色狠狠久久AV五月综合| 亚洲欧美日韩久久精品| 国产福利电影一区二区三区久久老子无码午夜伦不 | 国产精品日韩欧美久久综合| 亚洲AV无码久久| 欧美一区二区久久精品| 国产精品丝袜久久久久久不卡| 99久久免费国产特黄| 亚洲精品无码专区久久久| 久久亚洲国产精品成人AV秋霞| 久久99精品免费一区二区| 国产欧美久久一区二区| 久久久久久久97| 无遮挡粉嫩小泬久久久久久久| 久久九九兔免费精品6| 日本WV一本一道久久香蕉| 久久这里有精品| 久久久久久精品久久久久| 亚洲国产综合久久天堂| 伊人久久国产免费观看视频|