Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

RichEdit Font

Posted on 1998-05-14
5
Medium Priority
?
683 Views
Last Modified: 2013-12-03
I need to change the font used by a RichEdit . What's the procedure ? (Basically I need to change only the font size)

Also do you have any idea why EM_SETSEL(-1,-1) selects all the text , instead putting the cursor at the end ? ( I use RichEdit 2.0 )

Thanks


0
Comment
Question by:WxW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1401552
Declare a CFont member in your class (Note that the lifetime of the font must be as long as the richedit). Then you can use richedit.SetFont(&m_Font); to change the font for all of the characters.

You can also use EM_SETCHARFORMAT to change a selection's font to something.

If you want to move the caret to the end, use

  int length = GetWindowTextLength();
  EM_SETSEL(length, length);


 
0
 
LVL 6

Author Comment

by:WxW
ID: 1401553
No I need the API procedure , because I have created the rich edit control using the Windows API and not visual objects | classes

0
 
LVL 6

Author Comment

by:WxW
ID: 1401554
Basically I do not find any HFONT - relative entry in the CHARFORMAT structure ....
0
 
LVL 6

Author Comment

by:WxW
ID: 1401555
Um - You were right I found it in CharFormat2
Please send an answer so I award it
And Thanks

0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 120 total points
ID: 1401556
You can use WM_SETFONT for to set the font too.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question