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. CDialog

CDialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
23 Posts 6 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.
  • H Hamid Taebi

    but i want to know why he cant show controls its attract for me to find answer for this question (of course i need to see his code that how to use)_**


    **_

    whitesky


    U Offline
    U Offline
    User 3037427
    wrote on last edited by
    #21

    My code is: BOOL CSliderDlg::OnEraseBkgnd(CDC* pDC) { if(m_clr.GetPos()!=0) { int color=m_clr.GetPos(); COLORREF clr=RGB(color,color,color); CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,clr); } return CDialog::OnEraseBkgnd(pDC); } I am calling this function from WM_HSCROLL handler. m_clr is the slider ctrl. If there is any mistake in my, let me that mistake. Thanx.:)

    H 1 Reply Last reply
    0
    • U User 3037427

      My code is: BOOL CSliderDlg::OnEraseBkgnd(CDC* pDC) { if(m_clr.GetPos()!=0) { int color=m_clr.GetPos(); COLORREF clr=RGB(color,color,color); CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,clr); } return CDialog::OnEraseBkgnd(pDC); } I am calling this function from WM_HSCROLL handler. m_clr is the slider ctrl. If there is any mistake in my, let me that mistake. Thanx.:)

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

      this code it seems not problem i tested this code and it work fine of course without if(m_clr.GetPos()!=0) like this BOOL CAnswerDlg::OnEraseBkgnd(CDC* pDC) { //int color=m_clr.GetPos(); COLORREF clr=RGB(53,97,200); CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,clr); return TRUE; } and controls are visible you can use WM_CTLCOLOR with a brush and it work and i think it good for you_**


      **_

      whitesky


      U 1 Reply Last reply
      0
      • H Hamid Taebi

        this code it seems not problem i tested this code and it work fine of course without if(m_clr.GetPos()!=0) like this BOOL CAnswerDlg::OnEraseBkgnd(CDC* pDC) { //int color=m_clr.GetPos(); COLORREF clr=RGB(53,97,200); CRect rect; GetClientRect(&rect); pDC->FillSolidRect(&rect,clr); return TRUE; } and controls are visible you can use WM_CTLCOLOR with a brush and it work and i think it good for you_**


        **_

        whitesky


        U Offline
        U Offline
        User 3037427
        wrote on last edited by
        #23

        I want to change the back ground of dialog when i move the slider ctrl. That's why i used int color=m_clr.GetPos(); Ths background of the dialog was changing but the controls are not visible.

        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