Changing the Background Color of Individual CEdit controls in a CDialogBar 
Author Message
 Changing the Background Color of Individual CEdit controls in a CDialogBar

I have a MFC non document/view application. I created a CDialogBar that contains
CStatic (labels) and CEdit controls. I and able to set/display text in the
CDialogBar by using CWnd::SetWindowText.  I am able to change the background
color of the CEdit controls by adding a message handler for WM_CTLCOLOR in the
CDialogBar class.

I need to change the background color of one (1) of CEdit controls in the
CDialogBar for a status indication.  I cannot change the background color of just
one of the CEdit controls; it's either all or none.

Is there any way to do this.



Tue, 01 Apr 2003 03:00:00 GMT  
 Changing the Background Color of Individual CEdit controls in a CDialogBar

Derive your Own class from CEdit and handle WM_CTLCOLOR in the EditBox
level.

Cheers
Check Abdoul
-------------------



I have a MFC non document/view application. I created a CDialogBar that
contains
CStatic (labels) and CEdit controls. I and able to set/display text in the
CDialogBar by using CWnd::SetWindowText.  I am able to change the background
color of the CEdit controls by adding a message handler for WM_CTLCOLOR in
the
CDialogBar class.

I need to change the background color of one (1) of CEdit controls in the
CDialogBar for a status indication.  I cannot change the background color of
just
one of the CEdit controls; it's either all or none.

Is there any way to do this.



Tue, 01 Apr 2003 03:00:00 GMT  
 Changing the Background Color of Individual CEdit controls in a CDialogBar
Check:
http://codeguru.earthweb.com/editctrl/index.shtml

Good luck,
Pipo



I have a MFC non document/view application. I created a CDialogBar that
contains
CStatic (labels) and CEdit controls. I and able to set/display text in the
CDialogBar by using CWnd::SetWindowText.  I am able to change the background
color of the CEdit controls by adding a message handler for WM_CTLCOLOR in
the
CDialogBar class.

I need to change the background color of one (1) of CEdit controls in the
CDialogBar for a status indication.  I cannot change the background color of
just
one of the CEdit controls; it's either all or none.

Is there any way to do this.



Tue, 01 Apr 2003 03:00:00 GMT  
 Changing the Background Color of Individual CEdit controls in a CDialogBar
In your OnCtlColor function check for the ID of the control you want to
change:

case CTLCOLOR_EDIT: if (pWnd->GetDlgCtrlID() == ID_OF_SPECIAL_EDIT)
                        return m_hBrushEditColor;
                    else
                        return CDialogBar::OnCtlColor(...);

HTH, Jens

"Charles R. Roderick" schrieb:

Quote:

> I have a MFC non document/view application. I created a CDialogBar that contains
> CStatic (labels) and CEdit controls. I and able to set/display text in the
> CDialogBar by using CWnd::SetWindowText.  I am able to change the background
> color of the CEdit controls by adding a message handler for WM_CTLCOLOR in the
> CDialogBar class.

> I need to change the background color of one (1) of CEdit controls in the
> CDialogBar for a status indication.  I cannot change the background color of just
> one of the CEdit controls; it's either all or none.

> Is there any way to do this.



Fri, 04 Apr 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Changing Background Color of Embedded Control in a CDialogBar

2. Changing the default background color of disabled control (CEdit)

3. How to change background color of a dynamically created CEdit control

4. Change background color of disabled CEdit controls

5. Changing color of background of a CEdit control

6. Change background color of CDialogBar-derived class in CRebar

7. Changing Background Color of CDialogBar

8. Changing Background Color of CEdit - Problem With Double Clicking On Texts

9. How to change background color Of CEdit?

10. How to change background color of CEdit?

11. Changing CEdit background COLOR on FOCUS????

12. Change background color of CEdit in CEditView

 

 
Powered by phpBB® Forum Software