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. Image for the cookie policy date

Turning off selection rectangle

Hi,

I was wondering if it's possible to turn off the selection rectangle (the rectangle that is drawn from the mouse as you drag on the canvas). See the image attached for what i mean.

Obviously when using the pan tool etc the rectangle isn't drawn when you drag on the canvas. Is there anyway to replicate this?

Thanks,
John



diagramSelectionRectangle_48a3eab2.zip

2 Replies

JT Johnathan Tunnicliffe November 9, 2011 07:38 PM UTC

To answer my own question it looks like I can override SelectTool and override the Draw method and set that as my active tool on the controller of my diagram.



AA Amsath Ali M Syncfusion Team November 14, 2011 07:24 AM UTC

Hi Johnathan,

Thanks for your interest in Syncfusion products.

We suggest you to Set the SelectTool.TrackingStyle’s ‘LineColor’ property to ‘Transparent’ to hide the selection rectangle while dragging through the mouse. Please refer the below code snippet to achieve your requirement.

Here is the code snippet:
[C#]
void diagram1_MouseDown(object sender, MouseEventArgs e)
{
if (diagram1.Controller.ActiveTool.Name == "SelectTool")
{
((SelectTool)diagram1.Controller.ActiveTool).TrackingStyle.LineColor = Color.Transparent;
}
}

Here is the sample:
Forum SelectToolColor Change266915234.zip

Please try the above sample and let us know if you have any queries.

Regards,
Amsath Ali. M




Loader.
Live Chat Icon For mobile
Up arrow icon