-
May 31st, 2001, 07:52 AM
#1
How to change the font in RichEditCtrl
Hi,
I would like to change the default font of my richedit control, how can I do that ?
Thanks, Bye !
Braulio
Rate this post if helped.
-
May 31st, 2001, 08:43 AM
#2
Re: How to change the font in RichEditCtrl
Just define a CFont variable, and use CreatePointFont and SetFont. An example:
CFont myFont;
CRichEditCtrl editWnd; // or whatever class
myFont.CreatePointFont(120, "Courier New");
editWnd.SetFont(&edfont, TRUE);
The first value of CreatePointFont is the font size times 10, so 120 = 12 point font.
Hope that helps!
- fogel
-
May 26th, 2002, 07:06 PM
#3
Another solution:
VERIFY(m_Font.CreateFont(
16, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Levenim MT")); // lpszFacename
m_MyRichEditCtrl.SetFont(&m_Font, TRUE);
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
|