RedrawWindow + ListControl
-
Hi all i am using RedrawWindow for ListControl on OnEraseBkgnd.
BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
{
GetDlgItem(IDC_LIST)->RedrawWindow();
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(rect,RGB(250,273,354));
return TRUE;
}Then i am getting Listcontrol boarder disappear. Am i right or not? There is any different way to use RedrawWindow() function? Please help me. Thanks in advance
-
Hi all i am using RedrawWindow for ListControl on OnEraseBkgnd.
BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
{
GetDlgItem(IDC_LIST)->RedrawWindow();
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(rect,RGB(250,273,354));
return TRUE;
}Then i am getting Listcontrol boarder disappear. Am i right or not? There is any different way to use RedrawWindow() function? Please help me. Thanks in advance
Looks like you're trying to paint the control, and then immediately draw a solid rectangle over it. RedrawWindow invalidates the client region of your window. The borders are not part of that region. Then the FillSolidRect code kicks in and fills the dialog background. Now the WM_PAINT from your RedrawWindow call comes to your list controls message pump, and it redraws the invalidated region, the client area, but not the border. What behavior are you looking for?
-
Hi all i am using RedrawWindow for ListControl on OnEraseBkgnd.
BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
{
GetDlgItem(IDC_LIST)->RedrawWindow();
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(rect,RGB(250,273,354));
return TRUE;
}Then i am getting Listcontrol boarder disappear. Am i right or not? There is any different way to use RedrawWindow() function? Please help me. Thanks in advance
What are you trying do? Looks like you are trying to change the background color. If that is the case handle WM_CTLCOLOR message.