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

    Change the color of a CButton?

    Hiya!

    How do I change the color of a CButton? How do I change the color of a text in a CButton?

    Thanks
    Magnus


  2. #2
    Join Date
    Apr 1999
    Location
    Frankfurt, Germany
    Posts
    113

    Re: Change the color of a CButton?

    Hi,
    did You try WM_CTLCOLOR in the dialog class the button belongs to?
    Rudolf


  3. #3
    Join Date
    Apr 1999
    Posts
    5

    Re: Change the color of a CButton?

    Hi,

    For this you need to do two changes:

    1. the style of the button need to be owner draw.
    2. Trap WM_CTLCOLOR message.

    Hope this would help you.


    Regards,
    Rakesh

    Rakesh Verma
    SSI, New Delhi
    [email protected]

  4. #4
    Join Date
    May 1999
    Posts
    4

    Re: Change the color of a CButton?

    Try to catch WM_ERASEBKGND.
    Or try Ownerdraw )))).

    Kiesha

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