#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    USA
    Posts
    144
    Rep Power
    12

    static text color - what am I missing?


    Hi guys,

    I've been trying to change the color of a static text now for sometime but have still been unsuccessful - I followed this example on msdn which compiles fine but my static text color still remains black:

    http://msdn.microsoft.com/library/de...onctlcolor.asp

    (example is at the bottom)

    I've initialized my solid brush to a blue and then copied their example into my dialog app - IDC_MYSTATIC static still remains black!

    Thanks for your time - by the way, can anyone also tell me how to encapsulate a code chunk in these posts with the 'code' tags, I didn't see it in the how to post a question message.
  2. #2
  3. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    243

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    USA
    Posts
    144
    Rep Power
    12
    Thanks mitakeet -

    I also found what I was missing to get that text to take the color change - I needed to add:

    ON_WM_CTLCOLOR()

    to the message map. Then the rest of the sample code from msdn took effect.

IMN logo majestic logo threadwatch logo seochat tools logo