• <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 閱讀(534) 評論(0)  編輯 收藏 引用 所屬分類: MFC學(xué)習(xí)筆記
            久久久九九有精品国产| 久久av无码专区亚洲av桃花岛| 亚洲AV日韩精品久久久久久久| 久久婷婷五月综合97色直播| 日韩欧美亚洲综合久久影院Ds| 青青草国产97免久久费观看| 2021国内久久精品| 久久婷婷五月综合国产尤物app| 人妻久久久一区二区三区| 青青国产成人久久91网| 无码8090精品久久一区 | 99久久婷婷免费国产综合精品| 久久久久久国产精品无码超碰| 99国产精品久久| 欧美大战日韩91综合一区婷婷久久青草| 久久国产乱子伦精品免费午夜| 亚洲国产成人久久综合野外| 国内精品九九久久精品| 久久天堂电影网| 久久99久国产麻精品66| 亚洲午夜精品久久久久久人妖| 久久无码国产专区精品| www亚洲欲色成人久久精品| 久久精品免费一区二区| 日韩亚洲欧美久久久www综合网 | 国产精品免费久久| 久久综合精品国产一区二区三区 | 97视频久久久| 人妻无码αv中文字幕久久 | 日本五月天婷久久网站| 亚洲va久久久噜噜噜久久狠狠 | 深夜久久AAAAA级毛片免费看| 中文字幕乱码久久午夜| 91亚洲国产成人久久精品网址| 思思久久99热免费精品6| 亚洲国产精品无码久久青草| 婷婷久久精品国产| 国产精品亚洲美女久久久| 久久久久久伊人高潮影院| 99久久精品无码一区二区毛片| 亚洲色欲久久久综合网|