Click here to Skip to main content
15,030,954 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to change the font of Caption of CDialog..Since no resource id is associated with caption so we cant use SetFont ..tell how we can achieve this??

What I have tried:

SetFont() can't be applied as caption dont have resource id.
Posted
Updated 10-Oct-19 22:27pm

1 solution

You can set the font for the dialog in the dialog's resource definition.
   
Comments
Beginner_mfc 11-Oct-19 5:19am
   
Richard i am not ralking about dialogs font ,i am talking about title/caption font of dialog.Basically my requirement is make the title/caption of Dialog(derived) from CDialog Bold
Richard MacCutchan 11-Oct-19 6:51am
   
Sorry, it appears that the caption font is fixed by the system. You will need to handle the drawing of the frame to change that. The only way that i think it could be managed is by using the WM_NCPAINT message - Windows applications | Microsoft Docs[^]. But that gets a bit complicated.
Beginner_mfc 12-Oct-19 4:17am
   
Ok.Yeah but strange that we can't change a font style and size of caption
Richard MacCutchan 12-Oct-19 4:24am
   
The frame of a Window, which includes the caption, is managed by the operating system. All Windows programs have a common frame style. If you want something different then you have to manage the creation and painting of the frame yourself, which is not a trivial task.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900