user-0 提问: zedGraph控件里画框，中间拉线过程怎么实现？

回复:
user: user-1
content: 希望对你有帮助：https://blog.csdn.net/it_xiangqiang/category_10581430.html 希望对你有帮助：https://blog.csdn.net/it_xiangqiang/category_10768339.html

user: user-2
content: 仅供参考：///////////////////////////////////////////////////////////////////////////// // CTrackerView message handlers  void CTrackerView::OnLButtonDown(UINT nFlags, CPoint point) { 	CTrackerDoc* pDoc =	GetDocument(); 	CRect rectSave; 	pDoc->m_tracker.GetTrueRect(rectSave); 	if (pDoc->m_tracker.HitTest(point) < 0) 	{ 		// just	to demonstrate CRectTracker::TrackRubberBand 		CRectTracker tracker; 		if (tracker.TrackRubberBand(this, point, pDoc->m_bAllowInvert)) 		{ 			MessageBeep(0);	// beep	indicates TRUE  			// see if rubber band intersects with the doc's tracker 			CRect rectT; 			tracker.m_rect.NormalizeRect();	// so intersect	rect works 			if (rectT.IntersectRect(tracker.m_rect,	pDoc->m_tracker.m_rect)) 			{ 				// if so, put resize handles on	it (ie.	select it) 				if (pDoc->m_tracker.m_nStyle & CRectTracker::resizeInside) 				{ 					// swap	from resize	inside to resize outside for effect 					pDoc->m_tracker.m_nStyle &=	~CRectTracker::resizeInside; 					pDoc->m_tracker.m_nStyle |=	CRectTracker::resizeOutside; 				} 				else 				{ 					// just	use	inside resize handles on first time 					pDoc->m_tracker.m_nStyle &=	~CRectTracker::resizeOutside; 					pDoc->m_tracker.m_nStyle |=	CRectTracker::resizeInside; 				} 				pDoc->SetModifiedFlag(); 				pDoc->UpdateAllViews(NULL, (LPARAM)(LPCRECT)rectSave); 				pDoc->UpdateAllViews(NULL); 			} 		} 	} 	else if	(pDoc->m_tracker.Track(this, point,	pDoc->m_bAllowInvert)) 	{ 		// normal tracking action, when	tracker	is "hit" 		pDoc->SetModifiedFlag(); 		pDoc->UpdateAllViews(NULL, (LPARAM)(LPCRECT)rectSave); 		pDoc->UpdateAllViews(NULL); 	} 	CView::OnLButtonDown(nFlags, point); }   CRectTracker::TrackRubberBand BOOL TrackRubberBand( CWnd* pWnd, CPoint point, BOOL bAllowInvert = TRUE );  Return Value  Nonzero if the mouse has moved and the rectangle is not empty; otherwise 0.  Parameters  pWnd  The window object that contains the rectangle.  point  Device coordinates of the current mouse position relative to the client area.  bAllowInvert  If TRUE, the rectangle can be inverted along the x-axis or y-axis; otherwise FALSE.  Remarks  Call this function to do rubber-band selection. It is usually called from inside the function of your application that handles the WM_LBUTTONDOWN message (typically OnLButtonDown).  This function will capture the mouse until the user releases the left mouse button, presses the ESC key, or presses the right mouse button. As the user moves the mouse cursor, the feedback is updated by calling DrawTrackerRect and OnChangedRect.  Tracking is performed with a rubber-band-type selection from the lower-right handle. If inverting is allowed, the rectangle can be sized by dragging either up and to the left or down and to the right.  CRectTracker Overview |  Class Members |  Hierarchy Chart  See Also   CRectTracker::DrawTrackerRect, CRectTracker::OnChangedRect, CRectTracker::CRectTracker

user: user-0
content: 引用 4 楼 赵4老师的回复:仅供参考：///////////////////////////////////////////////////////////////////////////// // CTrackerView message handlers  void CTrackerView::OnLButtonDown(UINT nFlags, CPoint point) { 	CTrackerDoc* pDoc =	GetDocument(); 	CRect rectSave; 	pDoc->m_tracker.GetTrueRect(rectSave); 	if (pDoc->m_tracker.HitTest(point) < 0) 	{ 		// just	to demonstrate CRectTracker::TrackRubberBand 		CRectTracker tracker; 		if (tracker.TrackRubberBand(this, point, pDoc->m_bAllowInvert)) 		{ 			MessageBeep(0);	// beep	indicates TRUE  			// see if rubber band intersects with the doc's tracker 			CRect rectT; 			tracker.m_rect.NormalizeRect();	// so intersect	rect works 			if (rectT.IntersectRect(tracker.m_rect,	pDoc->m_tracker.m_rect)) 			{ 				// if so, put resize handles on	it (ie.	select it) 				if (pDoc->m_tracker.m_nStyle & CRectTracker::resizeInside) 				{ 					// swap	from resize	inside to resize outside for effect 					pDoc->m_tracker.m_nStyle &=	~CRectTracker::resizeInside; 					pDoc->m_tracker.m_nStyle |=	CRectTracker::resizeOutside; 				} 				else 				{ 					// just	use	inside resize handles on first time 					pDoc->m_tracker.m_nStyle &=	~CRectTracker::resizeOutside; 					pDoc->m_tracker.m_nStyle |=	CRectTracker::resizeInside; 				} 				pDoc->SetModifiedFlag(); 				pDoc->UpdateAllViews(NULL, (LPARAM)(LPCRECT)rectSave); 				pDoc->UpdateAllViews(NULL); 			} 		} 	} 	else if	(pDoc->m_tracker.Track(this, point,	pDoc->m_bAllowInvert)) 	{ 		// normal tracking action, when	tracker	is "hit" 		pDoc->SetModifiedFlag(); 		pDoc->UpdateAllViews(NULL, (LPARAM)(LPCRECT)rectSave); 		pDoc->UpdateAllViews(NULL); 	} 	CView::OnLButtonDown(nFlags, point); }   CRectTracker::TrackRubberBand BOOL TrackRubberBand( CWnd* pWnd, CPoint point, BOOL bAllowInvert = TRUE );  Return Value  Nonzero if the mouse has moved and the rectangle is not empty; otherwise 0.  Parameters  pWnd  The window object that contains the rectangle.  point  Device coordinates of the current mouse position relative to the client area.  bAllowInvert  If TRUE, the rectangle can be inverted along the x-axis or y-axis; otherwise FALSE.  Remarks  Call this function to do rubber-band selection. It is usually called from inside the function of your application that handles the WM_LBUTTONDOWN message (typically OnLButtonDown).  This function will capture the mouse until the user releases the left mouse button, presses the ESC key, or presses the right mouse button. As the user moves the mouse cursor, the feedback is updated by calling DrawTrackerRect and OnChangedRect.  Tracking is performed with a rubber-band-type selection from the lower-right handle. If inverting is allowed, the rectangle can be sized by dragging either up and to the left or down and to the right.  CRectTracker Overview |  Class Members |  Hierarchy Chart  See Also   CRectTracker::DrawTrackerRect, CRectTracker::OnChangedRect, CRectTracker::CRectTracker 谢谢您，非常详细的讲解不过还是没搞懂，我用了一个非常巧妙的办法，在mouseupevent事件下添加鼠标选中放大为false，这样借用了IsEnableZoom的选中过程

user: user-0
content: 引用 2 楼 赵4老师的回复:TRACKER 示例：阐释各种 CRectTracker 样式和选项 https://docs.microsoft.com/zh-cn/previous-versions/visualstudio/visual-studio-2008/ms177537(v=vs.90) 看不懂啊老师，我这例子可不可以简单加段代码实现呢？

user: user-2
content: TRACKER 示例：阐释各种 CRectTracker 样式和选项 https://docs.microsoft.com/zh-cn/previous-versions/visualstudio/visual-studio-2008/ms177537(v=vs.90)

user: user-0
content: 小白求教，根据已有代码怎么实现画框过程？还有鼠标坐标怎么绑zedGraph创建的坐标系