如何改变控件的字体 (老问题,好解决)
welcome to http://bccv.songstech.com/
由于控件是也是窗口,用户可以调用CWnd: : SetFont指定新字体。
//Declare font object in class declaration (.H file ). private : Cfont m_font ; // Set font in class implementation (.Cpp file ). Note m_wndButton is a //member variable added by ClassWizard.DDX routines hook the member //variable to a dialog button contrlo. BOOL CSampleDialog : : OnInitDialog ( ) ¡ //Create an 8-point Arial font m_font . CreateFont (MulDiv (8 , -pDC-> GetDeviceCaps (LOGPIXELSY) , 72). 0 , 0 , 0 , FW_NORMAL , 0 , 0, 0, ANSI_CHARSER, OUT_STROKE_PRECIS , CLIP_STROKE _PRECIS , DRAFT _QUALITY VARIABLE_PITCH £üFF_SWISS, _T ("Arial") ); //Set font for push button . m_wndButton . SetFont (&m _font ); ¡ }
其实基本就是酱紫了
注:转载文章需注明来源:VCer.net 文章地址:http://vcer.net/1482.html
如果你觉得VCer.net不错,而且你愿意为VCer.net捐赠一元钱,那么点击后面的捐赠按钮吧:)
A B C D E
bluejoe 于 2004-04-17 21:15:36.0 编辑 [回复该贴]