-
June 18th, 2020, 03:00 AM
#1
Setting Font of Buttons in CDialog through .rc file
I have the following code in .rc file
Code:
FONT 12, "MS Shell Dlg"
This code successfully sets the font of text inside the dialog(CDialog) to specifed face type but the font of text of buttons does not change.Anything missing to do that?
-
June 18th, 2020, 03:03 AM
#2
Re: Setting Font of Buttons in CDialog through .rc file
How are these buttons created? In the resources or dynamically?
Victor Nijegorodov
-
June 18th, 2020, 05:34 AM
#3
Re: Setting Font of Buttons in CDialog through .rc file
 Originally Posted by VictorN
How are these buttons created? In the resources or dynamically?
In the resource
-
June 18th, 2020, 05:42 AM
#4
Re: Setting Font of Buttons in CDialog through .rc file
And you don't additionally set/change buttons' font in the code. Do you?
Victor Nijegorodov
-
June 18th, 2020, 06:28 AM
#5
Re: Setting Font of Buttons in CDialog through .rc file
-
June 18th, 2020, 07:49 AM
#6
Re: Setting Font of Buttons in CDialog through .rc file
I tried drilling down it and found that as soon as i declare button as CMFCBUTTON in .h file and compile code than font is not reflected. On other side if i dont declare it as CMFCBUTTON ,font gets reflected properly
-
June 18th, 2020, 08:45 AM
#7
Re: Setting Font of Buttons in CDialog through .rc file
 Originally Posted by Sparsh_21j
I tried drilling down it and found that as soon as i declare button as CMFCBUTTON in .h file and compile code than font is not reflected. On other side if i dont declare it as CMFCBUTTON ,font gets reflected properly
Have a look at MSDN: you seem to need calling EnableMenuFont method (only a guess. cause I never used the CMFCButton class!)
Victor Nijegorodov
-
June 19th, 2020, 11:01 AM
#8
Re: Setting Font of Buttons in CDialog through .rc file
-
June 20th, 2020, 06:18 AM
#9
Re: Setting Font of Buttons in CDialog through .rc file
-
June 20th, 2020, 07:58 AM
#10
Re: Setting Font of Buttons in CDialog through .rc file
 Originally Posted by Sparsh_21j
That doesn't worked
Then set the dialog font for this CMFCButton.
Add this line on your OnInitDialog override:
Code:
...
{
CDialog::OnInitDialog();
myMFCButton.SetFont(GetFont());
...
}
where myMFCButton is the member variable of your CMFCButton.
Victor Nijegorodov
Tags for this Thread
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
|