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

controlnode backcolor

Hi, I have a few questions I'm hoping someone can answer.

1) I have a controlnode that hosts a usercontrol. I have set the background color of the usercontrol to transparent with the hopes that the background color of the diagram with be shown instead. However, this is not happening. Please see attachment. Can you give me any tips on how to make this happen?

2) What do I need to do in order to prevent line connectors from being selected or have focus? In my case the user should only be able to select the node but not the lines.

Thanks much!

GA

2 Replies

GA Giancarlo Aguilera July 26, 2007 10:21 PM UTC

forgot attachement


Doc122.zip


J. J.Nagarajan Syncfusion Team July 27, 2007 06:56 PM UTC

Hi GA,

Thanks for the update.

1. If you want to change the back color of the Windows control to Transparent then you could not change it to transparent. You can test this in an simple application. You can add a button control in a form and change the button's back color to transparent then it could not be changed to transparent. Similarly you can set transparent color to the control placed on a diagram. If you want to change the back color of the control node then please refer to the following code snippet

Button btn = new Button();
btn.Text = "Double Click to activate me";
btn.Click += new EventHandler( btn_Click );

ControlNode ctrlnode = new ControlNode( btn, new RectangleF( 100, 200, 150, 50 ) );
ctrlnode.HostingControl.BackColor = Color.Red;
this.diagram1.Model.AppendChild( ctrlnode );

2. If you want to prevent the selection of the connector then you can set its AllowSelect property to false. Please refer to the folloing code.

lineConnector.EditStyle.AllowSelect=false;

Please let me know if you have any questions.

Thanks,
Nagaraj

Loader.
Live Chat Icon For mobile
Up arrow icon