Z.K.
2006-06-22 15:31:54 UTC
I have a project that when the form appears on the screen I have to scroll
to the right to see the entire form. This is fine, but I also have a
rectangle I draw from one edge of the form to the other. When I scroll to
the right it does not draw the rectangle all the way, but if I resize the
form it does. How do I get the rectangle to redraw when I scroll to the
right and also how do I get the form to appear its full size when the
application starts. My OnDraw code is below:
Z.K.
void CT45662BLView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
//declare rectangle to hold window rectangle info
CRect WinRect;
//get window rectangle
::GetWindowRect(this->m_hWnd,&WinRect);
//store window rectangle width value
int width = WinRect.Width();
//create a solid color brush
CBrush aBrush(RGB(0,0,255));
//assign brush for drawing
pDC->SelectObject(&aBrush);
//draw rectangle
pDC->FillSolidRect(0,0,width,75,RGB(0,0,255));
}
to the right to see the entire form. This is fine, but I also have a
rectangle I draw from one edge of the form to the other. When I scroll to
the right it does not draw the rectangle all the way, but if I resize the
form it does. How do I get the rectangle to redraw when I scroll to the
right and also how do I get the form to appear its full size when the
application starts. My OnDraw code is below:
Z.K.
void CT45662BLView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
//declare rectangle to hold window rectangle info
CRect WinRect;
//get window rectangle
::GetWindowRect(this->m_hWnd,&WinRect);
//store window rectangle width value
int width = WinRect.Width();
//create a solid color brush
CBrush aBrush(RGB(0,0,255));
//assign brush for drawing
pDC->SelectObject(&aBrush);
//draw rectangle
pDC->FillSolidRect(0,0,width,75,RGB(0,0,255));
}