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
close icon

ActivateStyle of Controls

Hi, I have a custom symbol with a control node. When I add my symbol to the diagram the ControlNode is active although I set the ActivateSytle.DoubleClick. How can I avoid that my ControlNode is active when I add it to the diagram? [code] public PLSeeButton(): base() { ControlNode node = new ControlNode(new RectangleF(10, 10, 120, 60)); node.ControlAssemblyName = "System.Windows.Forms"; node.ControlClassName = "System.Windows.Forms.Button"; node.ActivateStyle = ActivateStyle.DoubleClick; node.Name = "Button"; node.CreateControl(); Button btn = node.Control as Button; btn.Text = "Zweimal klicken zum aktivieren"; this.Name = "Button"; this.ControlNode = node; this.AppendChild(node); } void diagramComponent_ControlNodeInfo(object sender, ControlNodeEventArgs evtArgs) { ControlNode ctrlnode = evtArgs.Node as ControlNode; ctrlnode.DeactivateControl(); } [/code] with regards, uli

4 Replies

AD Administrator Syncfusion Team March 23, 2006 01:03 PM UTC

Hi, To insert the Custom Symbol with a ControlNode use the InsertSymbolTool ,which is an interactive tool for adding custom symbol to the Diagram.It is the intended behaviour of the InsertSymbolTool to be active when added to the diagram. The insertion can be made by first creating and registering the InsertSymbolTool.Once the tool is registered we can add the Symbol to the Diagram using the ActivateTool(). Kindly, refer the ( Diagram.Windows\Samples\Technology\ControlsGalore ) Sample in particular the InsertTreeViewSymbol that would give you an idea about this implementation. Please let me know if this helps you. Regards, Praveena.


AD Administrator Syncfusion Team March 24, 2006 08:10 AM UTC

Hi Praveena, thanks a lot for your reply. I have tested your solution but as you had already posted "... the intended behaviour of the InsertSymbolTool to be active when added to the diagram." the added Symbol is active (tested with a Button). My diagrammer is combination of the SymbolDesigner an the DiagramBuilder therefore I will add the Controls through the SymbolModel. Anyway, when I run into a workaround I will post it here. thank you again, Uli


AD Administrator Syncfusion Team March 24, 2006 10:14 AM UTC

Hi, I would like to suggest you to use the SetPropertyCmd inorder to make the CustomSymbol to be inactive when added onto the Diagram. The SetPropertyCmd sets the value of the property in one or more nodes. I have created a sample that would help you to implement this. Kindly, refer the Sample and let me know if this helps you. Thanks, for your support to Syncfusion. Regards, Praveena.

ControlNodeSample.zip


JS Johann Schraml March 24, 2006 01:23 PM UTC

Hi Praveena, your sample solves the problem. Thank you very much :-) ! Uli

Loader.
Live Chat Icon For mobile
Up arrow icon