CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    5

    EXPERTS: How to change background color of ActiveX subclassed from an Edit/Combo control?



    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

  2. #2
    Join Date
    Apr 1999
    Location
    Florida
    Posts
    3

    Re: EXPERTS: How to change background color of ActiveX subclassed from an Edit/Combo control?

    Surely if you are deriving your class from the class from an Editbox Control,
    you can simply overide painting functions through a message map?



  3. #3
    Join Date
    Apr 1999
    Posts
    5

    Re: EXPERTS: How to change background color of ActiveX subclassed from an Edit/Combo control?

    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.


  4. #4
    Join Date
    Apr 2001
    Posts
    2

    Re: EXPERTS: How to change background color of ActiveX subclassed from an Edit/Combo control?

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured