• <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í)筆記
            亚洲国产精品无码久久久蜜芽| 久久精品国产亚洲网站| 国产精品久久新婚兰兰| 久久国产免费直播| 99久久人妻无码精品系列 | 久久青青草原综合伊人| 亚洲狠狠婷婷综合久久蜜芽| 2020久久精品亚洲热综合一本| 久久人人爽人人爽人人片AV高清| 久久综合狠狠综合久久| 久久成人精品| 久久久久久精品免费看SSS| 奇米综合四色77777久久| 亚洲国产视频久久| 欧美亚洲另类久久综合| 国产精品亚洲综合久久| 中文字幕一区二区三区久久网站| 日韩人妻无码精品久久免费一| 国产精品日韩欧美久久综合| 久久午夜福利无码1000合集| 久久99国产一区二区三区| 国产91色综合久久免费| 亚洲日本久久久午夜精品| 精品乱码久久久久久夜夜嗨| AV色综合久久天堂AV色综合在| 亚洲狠狠婷婷综合久久久久| 久久人人爽人人爽人人片AV高清| 色婷婷久久久SWAG精品| 精品人妻伦九区久久AAA片69| 九九99精品久久久久久| 欧美一区二区三区久久综| 久久精品国产清自在天天线| 亚洲国产成人精品女人久久久| 伊人久久综合热线大杳蕉下载| 97久久精品人人做人人爽| 色综合久久综合网观看| 国产精品青草久久久久福利99| 久久精品国产黑森林| 久久久久婷婷| 国产成年无码久久久免费| 久久婷婷成人综合色综合|