|
-
February 5th, 2009, 05:58 PM
#1
CEdit box with variable fonts
I want to change the fonts of the text in my mutli-line editbox. I've found how to change the default font of the entire control, but it is possible to just change one line to either bold or underline? If so, how?
For example: I currently write to the editbox like this:
CString textstr = "hello world\r\nFoobar";
CEdit * Editbox1 = (CEdit*) GetDlgItem(IDC_EDIT1);
Editbox1 ->SetWindowText(textstr);
How would I make "Foobar" bold, and "hello world" regular?
-
February 5th, 2009, 07:09 PM
#2
Re: CEdit box with variable fonts
I think that isn't possible. You may use rich control, in which you can format your text.
-
February 5th, 2009, 07:14 PM
#3
Re: CEdit box with variable fonts
how do I do that with visual c++ 6.0?
-
February 5th, 2009, 10:14 PM
#4
Re: CEdit box with variable fonts
 Originally Posted by acerunner316
how do I do that with visual c++ 6.0?
replace your CEdit with a CRichEditCtrl
-
February 6th, 2009, 03:40 PM
#5
Re: CEdit box with variable fonts
i mean how do you select certain portions of the text to be a specific font?
CRichEditCtrl uses SetFont() but that sets the entire control to that font.
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
|