How to set font
-
Hey, I posted this once and I am hoping to get some suggestions this time. If nobody knows, hey, that is life. I am trying to set the font/color, etc, for text in a multiline text editor. The user can highlight as many lines (or chars) as he/she wants, and then change all the text that has been selected to the font/color. The problem is that it is not working. I get the font characteristics, then call EM_SETCHARFORMAT with the SCF_SELECTION. According to MS website, this will change all the selected text. It doesn't. It seems, when there is a carriage return or word wrap of some kind, it cannot handle these characters. So it only changes 1 line. I do not know how to get around this. I have used EM_EXGETSEL and then send EM_EXSETSEL, this doesn't help either. Does anybody have any ideas? I have no clue how to get around the word break chars.
-
Hey, I posted this once and I am hoping to get some suggestions this time. If nobody knows, hey, that is life. I am trying to set the font/color, etc, for text in a multiline text editor. The user can highlight as many lines (or chars) as he/she wants, and then change all the text that has been selected to the font/color. The problem is that it is not working. I get the font characteristics, then call EM_SETCHARFORMAT with the SCF_SELECTION. According to MS website, this will change all the selected text. It doesn't. It seems, when there is a carriage return or word wrap of some kind, it cannot handle these characters. So it only changes 1 line. I do not know how to get around this. I have used EM_EXGETSEL and then send EM_EXSETSEL, this doesn't help either. Does anybody have any ideas? I have no clue how to get around the word break chars.
have a look to this article : http://www.codeproject.com/staticctrl/clabel.asp and also : CFont & LOGFONT where you can specified the type of font etc. Fred
-
Hey, I posted this once and I am hoping to get some suggestions this time. If nobody knows, hey, that is life. I am trying to set the font/color, etc, for text in a multiline text editor. The user can highlight as many lines (or chars) as he/she wants, and then change all the text that has been selected to the font/color. The problem is that it is not working. I get the font characteristics, then call EM_SETCHARFORMAT with the SCF_SELECTION. According to MS website, this will change all the selected text. It doesn't. It seems, when there is a carriage return or word wrap of some kind, it cannot handle these characters. So it only changes 1 line. I do not know how to get around this. I have used EM_EXGETSEL and then send EM_EXSETSEL, this doesn't help either. Does anybody have any ideas? I have no clue how to get around the word break chars.
I think it will be much easier should you use a rich edit control. Best regards, Alexandru Savescu
-
I think it will be much easier should you use a rich edit control. Best regards, Alexandru Savescu
LOL ;P Tomasz Sowinski -- http://www.shooltz.com
- It's for protection
- Protection from what? Zee Germans?