Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. changing the background color of CEdit

changing the background color of CEdit

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YanivNahum
    wrote on last edited by
    #1

    Hey, How can i change the background color of CEditBox and any other CDialog and is title color? Thanks Yaniv

    R B 2 Replies Last reply
    0
    • Y YanivNahum

      Hey, How can i change the background color of CEditBox and any other CDialog and is title color? Thanks Yaniv

      R Offline
      R Offline
      Ryan Binns
      wrote on last edited by
      #2

      Have a look at the WM_CTLCOLOR message. You'll have to handle it in your dialog class and return a brush to draw the background of the edit control with. You can also use WM_CTLCOLOR to change the background of the dialog - have a look at the docs as I can't remember exactly how to. :) To change the title bar colour, have a look at one of the (many) articles here on CP about drawing custom title bars, as it's too involved to put here. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
      Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

      1 Reply Last reply
      0
      • Y YanivNahum

        Hey, How can i change the background color of CEditBox and any other CDialog and is title color? Thanks Yaniv

        B Offline
        B Offline
        Brian Delahunty
        wrote on last edited by
        #3

        You need to handle CTLCOLOR messages. I have a CColourEdit box class I wrote a while back. I can email it to you tomorrow if you want [I'm not in work now]. It has all the SetBkColour(), SetTxtBkColour(), SetTxtColour() methods and a few more. If your interested let me know [drop me an email - click the email button at the bottom of this post] and I'll email it on to you. Regards, Brian Dela :-)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups