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. Customize ColorDialog

Customize ColorDialog

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
4 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.
  • V Offline
    V Offline
    velayudhan_raj
    wrote on last edited by
    #1

    how to change the background color of a custom color dialog

    H 1 Reply Last reply
    0
    • V velayudhan_raj

      how to change the background color of a custom color dialog

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      of course its not a good way but maybe its some helpful to you class CMyDialog: public CColorDialog { public: DECLARE_DYNCREATE(CMyDialog) CMyDialog(); ~CMyDialog(); DECLARE_MESSAGE_MAP() afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); }; IMPLEMENT_DYNCREATE(CMyDialog, CColorDialog) BEGIN_MESSAGE_MAP(CMyDialog, CColorDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() CMyDialog::CMyDialog() { } CMyDialog::~CMyDialog() { } HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CColorDialog::OnCtlColor(pDC, pWnd, nCtlColor); LOGBRUSH logBrush; logBrush.lbStyle = BS_HATCHED; logBrush.lbColor = RGB(100, 192, 192); logBrush.lbHatch = HS_CROSS; if(pWnd==this) SetWindowText("Test"); return CreateBrushIndirect(&logBrush); }_**


      **_

      whitesky


      S 1 Reply Last reply
      0
      • H Hamid Taebi

        of course its not a good way but maybe its some helpful to you class CMyDialog: public CColorDialog { public: DECLARE_DYNCREATE(CMyDialog) CMyDialog(); ~CMyDialog(); DECLARE_MESSAGE_MAP() afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor); }; IMPLEMENT_DYNCREATE(CMyDialog, CColorDialog) BEGIN_MESSAGE_MAP(CMyDialog, CColorDialog) ON_WM_CTLCOLOR() END_MESSAGE_MAP() CMyDialog::CMyDialog() { } CMyDialog::~CMyDialog() { } HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CColorDialog::OnCtlColor(pDC, pWnd, nCtlColor); LOGBRUSH logBrush; logBrush.lbStyle = BS_HATCHED; logBrush.lbColor = RGB(100, 192, 192); logBrush.lbHatch = HS_CROSS; if(pWnd==this) SetWindowText("Test"); return CreateBrushIndirect(&logBrush); }_**


        **_

        whitesky


        S Offline
        S Offline
        suja sreekumar
        wrote on last edited by
        #3

        is there any way to change the color of the buttons and the static texts??

        H 1 Reply Last reply
        0
        • S suja sreekumar

          is there any way to change the color of the buttons and the static texts??

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          See WM_CTLCOLORSTATIC_**


          **_

          whitesky


          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