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