• <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函數(shù)中插入一下代碼:
            m_font.CreatePointFont(909,_T("宋體"));
            GetDlgItem(IDC_TEST)
            ->SetFont(&m_font);
            編譯后便可看見效果

            說明:
            在我第一次嘗試更改控件變量的字體時,使用了如下的代碼:
            CFont font
            font.CreatePointFont(
            909,_T("宋體"));
            GetDlgItem(IDC_TEST)
            ->SetFont(&font);

            結(jié)果,控件的字體并沒有改變。后來得知SetFont函數(shù)有如下要求:
            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. "便是關(guān)鍵。
            所以在更該控件的字體時,CFont對象必須是靜態(tài)或者成員變量。
            posted on 2009-12-30 22:05 zhaoyg 閱讀(521) 評論(0)  編輯 收藏 引用 所屬分類: MFC學(xué)習(xí)筆記
            精品久久久久久久久久中文字幕 | 久久久久波多野结衣高潮| 国产毛片久久久久久国产毛片 | 7777久久亚洲中文字幕| 97久久香蕉国产线看观看| 99久久99久久精品国产片| 亚洲а∨天堂久久精品| 国内精品久久久久影院一蜜桃| 91精品婷婷国产综合久久| 中文字幕精品久久| 狠狠色丁香久久综合婷婷| 日本精品一区二区久久久| 国产亚洲精品自在久久| 亚洲国产成人久久一区WWW| 国产91色综合久久免费| 欧美精品国产综合久久| AA级片免费看视频久久| 伊人久久综合成人网| 婷婷久久综合九色综合九七| 伊人久久大香线蕉亚洲| 久久久人妻精品无码一区| 久久久久无码国产精品不卡| 色妞色综合久久夜夜| 色综合久久中文字幕综合网| 国产精品久久网| 久久婷婷五月综合97色一本一本| 色偷偷91久久综合噜噜噜噜 | 久久狠狠色狠狠色综合| 国产成人无码精品久久久性色| 久久精品成人| 久久亚洲精品无码观看不卡| 久久精品国产亚洲网站| 国内精品久久久久久99| 亚洲中文字幕无码久久精品1| 久久综合偷偷噜噜噜色| 久久经典免费视频| 久久久无码精品亚洲日韩蜜臀浪潮| 久久精品国产亚洲Aⅴ香蕉| 欧美激情精品久久久久久久九九九| 久久精品国产一区二区| 亚洲国产日韩综合久久精品|