• <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 閱讀(520) 評論(0)  編輯 收藏 引用 所屬分類: MFC學習筆記
            97精品伊人久久久大香线蕉| 天天做夜夜做久久做狠狠| 日韩欧美亚洲国产精品字幕久久久 | 亚洲国产成人精品女人久久久| 婷婷五月深深久久精品| 久久人人爽人人爽人人爽| 久久精品国产亚洲av瑜伽| 很黄很污的网站久久mimi色 | 少妇高潮惨叫久久久久久| 综合久久国产九一剧情麻豆| 精品久久久无码人妻中文字幕| 日韩欧美亚洲国产精品字幕久久久| 久久婷婷人人澡人人| 天堂无码久久综合东京热| 中文成人无码精品久久久不卡| 久久人人爽人人人人片av| 亚洲AV日韩精品久久久久久| 亚洲AV无码久久精品蜜桃| 一本色道久久88精品综合| 91精品国产高清久久久久久io| 99久久精品国内| 精品无码人妻久久久久久| 久久久精品久久久久特色影视| 日韩精品久久久久久久电影| 18岁日韩内射颜射午夜久久成人| 九九99精品久久久久久| 人妻无码久久精品| 99久久99这里只有免费费精品| 999久久久国产精品| 国产毛片欧美毛片久久久| 91精品国产91久久| 亚洲精品午夜国产VA久久成人| 狠狠干狠狠久久| 精品久久亚洲中文无码| 国产伊人久久| 欧洲成人午夜精品无码区久久| 国产99久久久国产精免费| 精品伊人久久大线蕉色首页| 国产午夜福利精品久久| 久久狠狠高潮亚洲精品| 中文成人无码精品久久久不卡|