Sorry, we misunderstood. The problem is not setting the colors (it works great the way you described), but doing custom painting (not only changing some colors) inside the CEdit (here: drawing some static, gayed text when the control ist "empty").

Thank you for your reply and I hope it's now more clearly what I want to do.