colorful text in Edit?
-
:doh:I have a static control(derived from CStatic) and it contains two lines. I want to set the color of the first line to blue and the second line to red. Currently I am using the CDialog::OnCtlColor and using the SetTextColor function to set the color. However it sets the color for the whole static control i.e. both the lines. Can someone help?
-
:doh:I have a static control(derived from CStatic) and it contains two lines. I want to set the color of the first line to blue and the second line to red. Currently I am using the CDialog::OnCtlColor and using the SetTextColor function to set the color. However it sets the color for the whole static control i.e. both the lines. Can someone help?
The OnCtlColor message doesn't give you that amount of control over the text lines that gets coloured. In cases like that where you need very flexable colour control, you might as well use the rich edit control, or search for one the various HTML-CStatic hybrids that are available on this site.
I Dream of Absolute Zero
-
:doh:I have a static control(derived from CStatic) and it contains two lines. I want to set the color of the first line to blue and the second line to red. Currently I am using the CDialog::OnCtlColor and using the SetTextColor function to set the color. However it sets the color for the whole static control i.e. both the lines. Can someone help?
LeeeNN wrote:
Currently I am using the CDialog::OnCtlColor and using the SetTextColor function to set the color. However it sets the color for the whole static control i.e. both the lines. Can someone help?
Try this Control http://www.codeproject.com/staticctrl/pphtmlstatic.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV