More Related Content
More from Razvan Raducanu, PhD
More from Razvan Raducanu, PhD (20)
MFC Rect2
- 8. void CRect2View::OnRButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CRect rect;
GetClientRect(&rect);
CPen pen(PS_SOLID, 2, RGB(255, 0, 0));
dc.SelectObject(&pen);
for (int x = 0; x < rect.Width(); x += 20)
{
dc.MoveTo(x, 0);
dc.LineTo(x, rect.Height());
}
CView::OnRButtonDown(nFlags, point);
}
- 13. void CRect2View::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CRect rect;
GetClientRect(&rect);
CPen pen(PS_SOLID, 2, RGB(0, 0, 255));
dc.SelectObject(&pen);
for (int x = 0; x < rect.Height(); x += 20)
{
dc.MoveTo(0, x);
dc.LineTo(rect.Width(), x);
}
CView::OnLButtonDown(nFlags, point);
}