Click here to Skip to main content
15,907,326 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: "Changing Editbox color" Pin
prasad_som13-Mar-07 21:13
prasad_som13-Mar-07 21:13 
AnswerRe: "Changing Editbox color" Pin
harsh_296113-Mar-07 22:32
harsh_296113-Mar-07 22:32 
QuestionRe: "Changing Editbox color" Pin
prasad_som13-Mar-07 22:39
prasad_som13-Mar-07 22:39 
AnswerRe: "Changing Editbox color" Pin
harsh_296113-Mar-07 23:35
harsh_296113-Mar-07 23:35 
AnswerRe: "Changing Editbox color" Pin
prasad_som14-Mar-07 2:32
prasad_som14-Mar-07 2:32 
QuestionRe: "Changing Editbox color" Pin
Parthi_Appu13-Mar-07 21:17
Parthi_Appu13-Mar-07 21:17 
AnswerRe: "Changing Editbox color" Pin
harsh_296113-Mar-07 22:30
harsh_296113-Mar-07 22:30 
GeneralRe: "Changing Editbox color" Pin
Parthi_Appu13-Mar-07 23:57
Parthi_Appu13-Mar-07 23:57 
harsh_2961 wrote:
along with the line m_List.SetBkColor(RGB(255, 255, 255));
in oninitdialog().


Hope the m_List is your CEdit control.


harsh_2961 wrote:
HBRUSH CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_brush;
}


Instead of simply returning m_brush(hope this the brush to paint the dialog background). Try this,
CFileopenDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
 HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
 if (CTLCOLOR_EDIT != nCtlColor)
   return m_brush;
 return hbr;
}

The above change the background color for all the controls in the dialog except for the CEdit controls.
If you want to change the color only to the dialog then change the 'if' condition as below
if (CTLCOLOR_DLG == nCtlColor)



Do your Duty and Don't expect the Result

GeneralRe: "Changing Editbox color" Pin
harsh_296114-Mar-07 0:14
harsh_296114-Mar-07 0:14 
AnswerRe: "Changing Editbox color" Pin
Hamid_RT13-Mar-07 21:19
Hamid_RT13-Mar-07 21:19 
AnswerRe: "Changing Editbox color" [modified] Pin
_AnsHUMAN_ 13-Mar-07 22:47
_AnsHUMAN_ 13-Mar-07 22:47 
AnswerRe: "Changing Editbox color" Pin
ThatsAlok15-Mar-07 0:32
ThatsAlok15-Mar-07 0:32 
AnswerRe: "Changing Editbox color" Pin
prasad_som15-Mar-07 2:15
prasad_som15-Mar-07 2:15 
QuestionI need to check the mail id is valid or not (existed or not) and whether password is correct or not? Pin
G Haranadh13-Mar-07 20:15
G Haranadh13-Mar-07 20:15 
AnswerRe: I need to check the mail id is valid or not (existed or not) and whether password is correct or not? Pin
G Haranadh13-Mar-07 23:11
G Haranadh13-Mar-07 23:11 
GeneralRe: I need to check the mail id is valid or not (existed or not) and whether password is correct or not? Pin
G Haranadh14-Mar-07 7:01
G Haranadh14-Mar-07 7:01 
QuestionCString: Heap Vs Stack? Pin
devvvy13-Mar-07 19:52
devvvy13-Mar-07 19:52 
AnswerRe: CString: Heap Vs Stack? Pin
Michael Dunn13-Mar-07 20:05
sitebuilderMichael Dunn13-Mar-07 20:05 
AnswerRe: CString: Heap Vs Stack? Pin
prasad_som13-Mar-07 21:18
prasad_som13-Mar-07 21:18 
Questioncancel dialog Pin
deeps_cute13-Mar-07 19:17
deeps_cute13-Mar-07 19:17 
AnswerRe: cancel dialog Pin
Parthi_Appu13-Mar-07 19:23
Parthi_Appu13-Mar-07 19:23 
GeneralRe: cancel dialog -- ok then how Pin
deeps_cute13-Mar-07 21:22
deeps_cute13-Mar-07 21:22 
AnswerRe: cancel dialog -- ok then how Pin
Parthi_Appu13-Mar-07 21:30
Parthi_Appu13-Mar-07 21:30 
GeneralRe: cancel dialog -- ok then how Pin
deeps_cute13-Mar-07 21:37
deeps_cute13-Mar-07 21:37 
GeneralRe: cancel dialog -- ok then how Pin
Parthi_Appu13-Mar-07 21:46
Parthi_Appu13-Mar-07 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.