public override bool HandleMouseMoveEvent(ZedGraphControl sender, MouseEventArgs e) { using (var g = sender.CreateGraphics()) { object nearestObject; int index; if (FindNearestObject(e.Location, g, out nearestObject, out index)) { var lineItem = nearestObject as LineItem; if (lineItem != null) { var objectList = lineItem.Tag as List <object>; if (objectList != null) { _selectedData = (AreaCVGraphData.CVData)objectList[index]; sender.Cursor = Cursors.Hand; return(true); } } } _selectedData = null; sender.Cursor = Cursors.Cross; return(base.HandleMouseMoveEvent(sender, e)); } }
public override void HandleMouseClick(object sender, MouseEventArgs e) { if (_selectedData != null && e.Button == MouseButtons.Left) { HistogramHelper.CreateAndShowFindResults((ZedGraphControl)sender, GraphSummary, _document, _selectedData); _selectedData = null; } }
public override bool HandleMouseMoveEvent(ZedGraphControl sender, MouseEventArgs e) { using (var g = sender.CreateGraphics()) { object nearestObject; int index; if (FindNearestObject(e.Location, g, out nearestObject, out index) && nearestObject is BarItem) { _selectedData = (AreaCVGraphData.CVData)((BarItem)nearestObject).Points[index].Tag; sender.Cursor = Cursors.Hand; return(true); } else { _selectedData = null; sender.Cursor = Cursors.Cross; return(base.HandleMouseMoveEvent(sender, e)); } } }