Click to See Complete Forum and Search --> : EXPERTS: How to change background color of ActiveX subclassed from an Edit/Combo control?


Oren Lev
March 30th, 1999, 02:54 AM
I have an edit box and a combo box subclassed from an ATL ActiveX control (done with the wizard). How can I change the background and text colors on an event (for example OnClick).

I tried using WM_CTLCOLOREDIT but that only works on the edit box...


I also tried using a composite control with MFC support and planting a CEdit on it, but I don't know how to go on from there concerning the colors.


Any help would be appriciated...


Thanks,

Oren

ChrisB
April 7th, 1999, 09:56 AM
Surely if you are deriving your class from the class from an Editbox Control,
you can simply overide painting functions through a message map?

Oren Lev
May 6th, 1999, 09:45 AM
If you mean painting the rectangle of the edit box, then it doesn't work, because then the text disappears...
I was looking for a more generic solution that preferably would also work for ATL.

mohannaidu100
May 2nd, 2001, 10:58 PM
Hi there,
Does changing of color for disabled edit boxes in composite controls work? I tried using WM_CTLCOLOREDIT message but it doesn't work for disabled edit boxes. I even tried WM_CTLCOLORSTATIC. It doesn't seem to work.

I know that this is irrelevant to your question but I was working on this last week. I was curious about it.

thanx,
mohan