We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Restricting tool activity

Thread ID:

Created:

Updated:

Platform:

Replies:

100440 Aug 8,2011 02:50 AM Aug 15,2011 08:46 AM Windows Forms 1
loading
Tags: Diagram
John Previn Kumar
Asked On August 8, 2011 02:50 AM

Can we make a tool inactive in certain place of the diagram? I need to be able to draw circles on upper left corner of the diagram control. for eg) If diagram control is 100X100 pixels size, I need to restrict drawing of circles only on top left 50X50 pixels.


Pandi Murugan A [Syncfusion]
Replied On August 15, 2011 08:46 AM

Hi JVM,

Thanks for using Syncfusion products and sorry for the delay in getting back to you.

You can achieve your requirement by aborting the drawing tool. Here is the code snippet for your reference.

[C#]
diagram1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.diagram1_MouseMove);
private void diagram1_MouseMove(object sender, MouseEventArgs e)
{
EllipseTool tool = diagram1.Controller.ActiveTool as EllipseTool;
if (tool != null)
{
PointF curPt = diagram1.Controller.ConvertToModelCoordinates(e.Location);
if (curPt.X > 50 || curPt.Y > 50)
{
tool.Abort();
diagram1.Refresh();
}
}
}


Please let me know if you have any concerns.

Regards,
Pandi Murugan A


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;