Hi all,
Here is what I am trying to accomplish. I am using the ZedGraph control (coding using C++/Cli) and am trying to save the current mouse position on the graph using a combination of mouse button pressed and the 'Alt' key. I've accomplished this with the following code.
private: System::Boolean zGC_MouseDownEvent(ZedGraph::ZedGraphControl^ sender, System::Windows::Forms::MouseEventArgs^ e)
{
if(sender->ModifierKeys == Keys::Alt)
{
// Save the mouse location
PointF^ mousePt = gcnew PointF( e->X, e->Y );
// Find the Chart rect that contains the current mouse location
GraphPane^ pane = sender->MasterPane->FindChartRect( *mousePt );
if(pane)
{
double x, y;
pane->ReverseTransform(*mousePt, x, y);
System::Windows::Forms::MessageBox::Show("Mouse Y value: " + y.ToString("f6"));
}
}
return false;
}
What I would like to do is add the x and y values that I've saved in the MouseDownEvent directly to a DataGridView programmatically (unbound). The display grid is in the Form directly below the graph and its purpose is simply to store and display x,y coordinates whenever that particular key/mouse combination is pressed. Every time it is pressed the cell in focus should receive the x,y coordinates and then the focus should shift to the next cell. Any suggestions on how to do this? I'm not sure if my description is clear enough as to what I'm trying to do so please feel free to ask/suggest information that I might be missing.
Cheers,
Alex