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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Change Colour of CEdit on Dialog Bar

Change Colour of CEdit on Dialog Bar

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • C Offline
    C Offline
    Cliff Hatch
    wrote on last edited by
    #1

    I have changed the text and background colours of CEdit's in dialog boxes in the past by overriding OnCtlColor. Now I'm trying to do the same thing with a CEdit in a Control Bar. I thought I would be able to override OnCtlColor in CMainFrame but I'm having trouble getting this to work. CMainFrame doesn't seem to receive the WM_CTLCOLOR messsages, although it receives and successfully handles many other messages from the bar:confused:. I attached the dialog bar to the CMainFrame in OnCreate like this: m_MessagesDlgBar.Create(this, IDD_MESSAGES, CBRS_BOTTOM, IDD_MESSAGES); Does anyone know where I'm going wrong? Any assistance would be gratefully received. Best Regards Cliff Hatch

    J 1 Reply Last reply
    0
    • C Cliff Hatch

      I have changed the text and background colours of CEdit's in dialog boxes in the past by overriding OnCtlColor. Now I'm trying to do the same thing with a CEdit in a Control Bar. I thought I would be able to override OnCtlColor in CMainFrame but I'm having trouble getting this to work. CMainFrame doesn't seem to receive the WM_CTLCOLOR messsages, although it receives and successfully handles many other messages from the bar:confused:. I attached the dialog bar to the CMainFrame in OnCreate like this: m_MessagesDlgBar.Create(this, IDD_MESSAGES, CBRS_BOTTOM, IDD_MESSAGES); Does anyone know where I'm going wrong? Any assistance would be gratefully received. Best Regards Cliff Hatch

      J Offline
      J Offline
      Jack Puppy
      wrote on last edited by
      #2

      VS 2003 I created a dialog bar using the instructions in this article: (minus the InitDialog addition) http://support.microsoft.com/default.aspx?scid=kb;en-us;185672 then added a WM_CTLCOLOR handler from within the CDialogBar derived class. Worked fine for me.

      :suss: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!

      C 1 Reply Last reply
      0
      • J Jack Puppy

        VS 2003 I created a dialog bar using the instructions in this article: (minus the InitDialog addition) http://support.microsoft.com/default.aspx?scid=kb;en-us;185672 then added a WM_CTLCOLOR handler from within the CDialogBar derived class. Worked fine for me.

        :suss: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!

        C Offline
        C Offline
        Cliff Hatch
        wrote on last edited by
        #3

        Thanks Jack. It works fine for me too:) I have some other dialog bars that I will be able to convert usefully in this manner, to reduce the clutter in CMainFrame. Best Regards Cliff

        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