public void TapeMeasure(object sender, EventArgs e)
{
if (TrussManager.Truss != null)
{
Point containerPoint = trussEditor.PointToClient(Cursor.Position);
if (!trussEditor.MainMenu.CommandToolStrip.ClientRectangle.Contains(containerPoint))
execute command A
else
execute command B
}
}
this event is called from
ToolStripButton commandButton = new ToolStripButton("Tape", ConvertIconToImage(icon), TapeMeasure);
and
ToolStripMenuItem tsmi = new ToolStripMenuItem("Tape", ConvertIconToImage(icon), TapeMeasure);
(Winforms Application)
I want to know when my cursor is not my Toolstrip. However the above code keeps returning the same result regardless of where my cursor is.
This code is located in an eventhandler that is called from either a button on Toolstrip or a Button on a contextmenu. If its called on a context menu, I assume the user wants to use the current mousepoint. Otherwise I want the user to go click the point they want
any suggestions?