Paint the CEdit

Posted on 1999-11-17
Medium Priority
Last Modified: 2013-11-20
I need to paint a CEdit control during
execution of the program.

I tried using SetBackColor but it didnt compile. Some one said that I have to be able to catch messages. If this is
the case than I need someone to help me please. A working piece of code is appreciated
Question by:VirtualReality
1 Comment

Accepted Solution

Vinayak Kumbar earned 60 total points
ID: 2215959

I suppose that edit box is in a dialog box say CMyDlg
Then map OnInitDialog() and OnCtlColor() function to that dialog. Declare m_MyBrush as CBrush in doalog.h file

and put the following code

In OnInitDialog()


and in OnCtlColor()
if(nCtlColor == CTLCOLOR_EDIT)
    return m_MyBrush;

Hope that helps

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question