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. I have a editbox in my toolbar and want change background color

I have a editbox in my toolbar and want change background color

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 2 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.
  • W Offline
    W Offline
    whofmans
    wrote on last edited by
    #1

    Hi, I have a SDI application with a editbox in the toolbar, now i want give the editbox another background color. Can someone help me with this? I have tried to put a WM_CTLCOLOR handler in CAppView and in CMainFrame, but i don't receive the WM_CTLCOLOR message. Thanks, Willem

    D 1 Reply Last reply
    0
    • W whofmans

      Hi, I have a SDI application with a editbox in the toolbar, now i want give the editbox another background color. Can someone help me with this? I have tried to put a WM_CTLCOLOR handler in CAppView and in CMainFrame, but i don't receive the WM_CTLCOLOR message. Thanks, Willem

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      I believe you'll need to derive a class from CEdit. In that class, handle the WM_CTLCOLOR message.

      W 1 Reply Last reply
      0
      • D David Crow

        I believe you'll need to derive a class from CEdit. In that class, handle the WM_CTLCOLOR message.

        W Offline
        W Offline
        whofmans
        wrote on last edited by
        #3

        Thanks! The editbox works, but how can i add a messagehandler? The "Add Message Handler" menu is not there. I have tried this. BEGIN_MESSAGE_MAP(CStatusEditBox, CEdit) ON_WM_CTLCOLOR() END_MESSAGE_MAP() I get the following compiler error: 'GetMessageMap' : member function not declared in 'CStatusEditBox'

        D 1 Reply Last reply
        0
        • W whofmans

          Thanks! The editbox works, but how can i add a messagehandler? The "Add Message Handler" menu is not there. I have tried this. BEGIN_MESSAGE_MAP(CStatusEditBox, CEdit) ON_WM_CTLCOLOR() END_MESSAGE_MAP() I get the following compiler error: 'GetMessageMap' : member function not declared in 'CStatusEditBox'

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Did you use ClassWizard to derive CStatusEditBox from CEdit? The error message you got about GetMessageMap() was because the DECLARE_MESSAGE_MAP macro was missing from the CStatusEditBox class. You can add it manaully, but it's usually better to let ClassWizard do this, and more, for you.

          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