I am showing a ContextMenuStrip on my chart when pressing the right mousebutton. What I want now is, that there shows up an additional MenuItem if the mouspointer is located over a CursorTool while opening the ContextMenuStrip.
Code: Select all
for (int i = 0; (i < isgChart1.mCursorCounter) && (hitScooter == -1); i++)
if (((Steema.TeeChart.Tools.CursorTool)isgChart1.mCursorCollection[i]).Clicked(contextMenuStrip1.Left, contextMenuStrip1.Top) != Steema.TeeChart.Tools.CursorClicked.None)
{
hitScooter = i;
}
}
deleteScooterToolStripMenuItem.Visible = (hitScooter != -1);
}
I tried to determine the real position of the CursorTool by the following code:
Code: Select all
int xPos=0;
int yPos=0;
for (int i = 0; (i < isgChart1.mCursorCounter) && (hitScooter == -1); i++)
{
for (int x = 0; x < 1300; x += 2)
{
for (int y = 0; y < 1100; y += 50)
{
if ((isgChart1.mCursorCollection[i] != null) && (((Steema.TeeChart.Tools.CursorTool)isgChart1.mCursorCollection[i]).Clicked(x, y) != Steema.TeeChart.Tools.CursorClicked.None))
{
xPos=x;
yPos=y;
}
}
}
}
To cut a long story short: How can I come to the desired result?
best wishes,
Rf.