|
-
June 7th, 1999, 04:14 AM
#1
changing default font
How to change the font of a control?eg., button control.thanks
-
June 7th, 1999, 04:19 AM
#2
Re: changing default font
You will need to create a CFont object in the class dealing with the control, i.e. if the control is on a Dialog box, embed the CFont in the CDialog derived class. Create the font in your class constructor. In the OnInitDialog() function, use the SetFont function for your control either as :
GetDlgItem(IDC_CONTROL)->SetFont(&font) ;
or
m_control_name.SetFont(&font) ;
Don't forget to destroy the CFont object in your destructor. You have to do the destruction after the controls you selected the font into have been destroyed.
Roger Allen
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
-
June 7th, 1999, 06:22 AM
#3
Re: changing default font
how to create a CFont object with predefined windows fonts?
-
June 7th, 1999, 06:57 AM
#4
Re: changing default font
The only way I know of doing this is to use the GetFont() function on an existing window and then apply that to your control. Of course you will have to get the font form a window you know has the font you want to use.
HTH
Roger Allen
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|