• <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學習筆記
            国产精品无码久久综合 | 久久久久一区二区三区| 999久久久无码国产精品| 日韩精品国产自在久久现线拍| 九九99精品久久久久久| 久久精品一本到99热免费| 99国产精品久久| 亚洲国产精品久久久久婷婷老年| 精品久久综合1区2区3区激情| 日日噜噜夜夜狠狠久久丁香五月| 94久久国产乱子伦精品免费| 久久本道综合久久伊人| 亚洲国产精品成人久久| 一本大道久久香蕉成人网| 国产成人久久AV免费| 国内精品久久久久久不卡影院| 久久久久人妻一区二区三区| 人人狠狠综合久久亚洲婷婷| 婷婷久久五月天| 欧美亚洲另类久久综合| 久久99精品国产麻豆蜜芽| 亚洲AV成人无码久久精品老人| 久久久久久久亚洲精品| 国产成人无码精品久久久免费 | 久久久久女教师免费一区| 日本欧美久久久久免费播放网| 久久人人爽人爽人人爽av| 久久人人爽人人爽人人片AV麻豆| 国产产无码乱码精品久久鸭| 97精品伊人久久久大香线蕉| 国产成人精品综合久久久| 久久久久无码中| 久久精品无码一区二区三区日韩| 久久91亚洲人成电影网站| 蜜臀久久99精品久久久久久小说| 欧美精品国产综合久久| 国产V综合V亚洲欧美久久| 性色欲网站人妻丰满中文久久不卡| 日韩一区二区三区视频久久| 伊人久久精品无码二区麻豆| 亚洲乱码精品久久久久.. |