is it true
I have designed one FormView, and i want to use OnLButtonDown() to update the graph on the Form, but i use the code.
void CRTForm::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
int white = RGB(255,255,255);
CPaintDC dc(this); // device context for painting
double m_dfMinX;
double m_dfMaxX;
double m_dfMinY;
double m_dfMaxY;
double m_dfDeltaX=1;
int xoffs=40;
int yoffs=10;
CRect rect1;
this->GetClientRect(&rect1);
//To make the background of rect1 and text are white
CBrush brBackground(white);
// FillRect(dc, rect1, brBackground);
// SetBkColor(dc,white);
m_dfMinX = rect1.left;
m_dfMaxX = rect1.right;
m_dfMinY = rect1.top;
m_dfMaxY = rect1.bottom;
RECT rect;
rect.left=(long)(m_dfMinX+xoffs);
rect.top=(long)(m_dfMinY+yoffs+20);
rect.bottom=(long)(m_dfMaxY-(m_dfMaxY-m_dfMinY)*5.7/10-yoffs+200);
rect.right=(long)(m_dfMaxX-xoffs);
CPen solidBluePen(PS_SOLID, 1, RGB(0, 0, 255));
CPen solidBlackPen(PS_SOLID, 1, RGB(0, 0, 0));
CPen dotPen(PS_DOT, 1, RGB(0, 0, 0));
CPen *pOldPen = dc.SelectObject(&solidBluePen);
dc.TextOut(xoffs+400,0,"Power Spectral");
pOldPen =dc.SelectObject(&solidBlackPen);
//to plot the rectangle boundary
dc.MoveTo(int(rect.left),int(rect.top));
dc.LineTo(int(rect.right),int(rect.top));
dc.LineTo(int(rect.right),int(rect.bottom));
dc.LineTo(int(rect.left),int(rect.bottom));//rect.bottom is the bottom y value of the rect
dc.LineTo(int(rect.left),int(rect.top));
CFormView::OnLButtonDown(nFlags, point);
}
to draw one rectangle on the Form, it cannot sucessful. To draw the graph on Form, does it need to put all code into OnDraw() or Onpaint() only? is it true?

