Changing text color in static text control
-
I have a customized Find Dialog (based on CFindReplaceDialog) to which I've added amongst other things a static text box for displaying results of the search in the CListCntl to which the dialog is attached. No problem. Then I thought it would be nice visually to say display "Find failed" in red, success in green. For something that seems like it should be dirt simple, I've plowed through more MSDN doc and CodeProject seemingly related items than I can believe. I must be missing something. Recommendations? Thanks.
-
I have a customized Find Dialog (based on CFindReplaceDialog) to which I've added amongst other things a static text box for displaying results of the search in the CListCntl to which the dialog is attached. No problem. Then I thought it would be nice visually to say display "Find failed" in red, success in green. For something that seems like it should be dirt simple, I've plowed through more MSDN doc and CodeProject seemingly related items than I can believe. I must be missing something. Recommendations? Thanks.
-
One solution is to add a handler for WM_CTLCOLOR. Update color of the static control inside the handler. Kuphryn
Yes. That was one avenue that led to a feeling of stupidity. Put a handler in the Find Dialog and SendMesssage to its window. I have yet to find a description of the proper setup of WM_CTLCOLOR wparam, lparam. Do you know a good source for such info? Thanks. Alex.
-
I have a customized Find Dialog (based on CFindReplaceDialog) to which I've added amongst other things a static text box for displaying results of the search in the CListCntl to which the dialog is attached. No problem. Then I thought it would be nice visually to say display "Find failed" in red, success in green. For something that seems like it should be dirt simple, I've plowed through more MSDN doc and CodeProject seemingly related items than I can believe. I must be missing something. Recommendations? Thanks.
Look up WM_CTLCOLORSTATIC in the MSDN Library. Trust in the code Luke. Yea right!
-
Look up WM_CTLCOLORSTATIC in the MSDN Library. Trust in the code Luke. Yea right!