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

Winforms Control on a Diagram

Hi, I''m tasked with evaluating Diagram for a possible utility for my company. Could you use Diagram to place custom Winform controls on a diagram instead of just drawing symbols? In other words can a control be placed on a diagram? How would one go about that? Many thanks, JohnB

17 Replies

AD Administrator Syncfusion Team August 11, 2004 12:57 PM UTC

Hi John, Essential Diagram at present does not have built-in support for hosting Windows Forms controls in a diagram. We already have a very high priority feature request on this issue and will definitely add the functionality for ''Control container'' Symbols in a future version of the product. However, one option that you could pursue for the time being would be to implement the Control creation/management functionality inside your application and map these controls to corresponding symbols on the diagram. While this approach will not be the exact equivalent of having native control-type symbols, it would provide functionality that closely resembles it. All you would have to do is subscribe to Diagram events that would notify you when the Symbol was created (Diagram.Model.ChildrenChanging/ChildrenChangeComplete), create and map your control to the symbol and use the Symbol''s bounds to add it to the Diagram control instance. You can then handle the Diagram.Model.BoundsChanged and Moved events to size/move the control with it''s parent symbol. It should be fairly simple to implement something along these lines and our support engineers will be happy to guide you with the details. Please let us know if any additional clarification is required. Regards, Prakash Surendra Syncfusion, Inc


BA Baddabing August 12, 2004 02:39 AM UTC

Thank you for your reply >Hi John, > >Essential Diagram at present does not have built-in support for hosting Windows Forms controls in a diagram. We already have a very high priority feature request on this issue and will definitely add the functionality for ''Control container'' Symbols in a future version of the product. > >However, one option that you could pursue for the time being would be to implement the Control creation/management functionality inside your application and map these controls to corresponding symbols on the diagram. While this approach will not be the exact equivalent of having native control-type symbols, it would provide functionality that closely resembles it. All you would have to do is subscribe to Diagram events that would notify you when the Symbol was created (Diagram.Model.ChildrenChanging/ChildrenChangeComplete), create and map your control to the symbol and use the Symbol''s bounds to add it to the Diagram control instance. You can then handle the Diagram.Model.BoundsChanged and Moved events to size/move the control with it''s parent symbol. It should be fairly simple to implement something along these lines and our support engineers will be happy to guide you with the details. > >Please let us know if any additional clarification is required. > >Regards, >Prakash Surendra >Syncfusion, Inc


AD Administrator Syncfusion Team August 12, 2004 08:52 PM UTC

Hi John, Following up on Prakash''s posting, here is a sample. In this sample a custom symbol called MySymbol with a button is added to the Diagram when you click on the Add MySymbol button. The main points are: - There is a custom Symbol class called MySymbol which consists of a outer Rectangle and an Ellipse. - This Symbol is added to the Diagram using a InsertNodesCmd by clicking on the Add MySymbol button. - In the Diagram''s ChildrenChangeComplete event, which is fired soon after MySymbol is added, a button is added to the Diagram within the bounds of the symbol. This button is centered within MySymbol and a click event is added for the button. - In the Model''s Moved event which is fired when any node in Diagram is moved, the button is repositioned within the bounds of the new location of MySymbol. - In the Model''s BoundsChanged event which is fired whenever any node is resized, the button is centered according to the new size of MySymbol. - The Button click event is fired when any button with MySymbol is clicked. Clicking it shows a messagebox with the name of the Symbol whose button was clicked. Do not hesitate to contact us if you have any further questions. Regards Arun


AD Administrator Syncfusion Team August 14, 2004 05:49 AM UTC

That helps so much! Thanks for going to the trouble of creating that sample!


GS Georg Schmidt September 8, 2004 03:48 AM UTC

Is there allready a target release date of that version? We have this problem too. Thanks, Georg >Hi John, > >Essential Diagram at present does not have built-in support for hosting Windows Forms controls in a diagram. We already have a very high priority feature request on this issue and will definitely add the functionality for ''Control container'' Symbols in a future version of the product. > >However, one option that you could pursue for the time being would be to implement the Control creation/management functionality inside your application and map these controls to corresponding symbols on the diagram. While this approach will not be the exact equivalent of having native control-type symbols, it would provide functionality that closely resembles it. All you would have to do is subscribe to Diagram events that would notify you when the Symbol was created (Diagram.Model.ChildrenChanging/ChildrenChangeComplete), create and map your control to the symbol and use the Symbol''s bounds to add it to the Diagram control instance. You can then handle the Diagram.Model.BoundsChanged and Moved events to size/move the control with it''s parent symbol. It should be fairly simple to implement something along these lines and our support engineers will be happy to guide you with the details. > >Please let us know if any additional clarification is required. > >Regards, >Prakash Surendra >Syncfusion, Inc


AD Administrator Syncfusion Team September 8, 2004 12:33 PM UTC

Hi Georg We are currently working on shipping a final version of Essential Diagram which will include Scripting support. We will then be looking at the feature list for the next version and I will update this posting as soon as this information becomes available. In the meantime, here is a modified version of the sample, where the button postion within the custom Symbol is adjusted on the basis of the bounds of the Symbol. Kindly take a look at this sample and let us know if you have any further quesions. Regards Arun


GS Georg Schmidt January 18, 2005 07:41 AM UTC

Hi. Are there new information about a release date of control support? Thanks, Georg


AD Administrator Syncfusion Team January 19, 2005 12:23 PM UTC

Hi Georg, I am very sorry, but control hosting capability will not be featured for the forthcoming 3.1 version of Essential Diagram. However, I would like to assure you that we have deemed this functionality as critical and will definitely work on providing it for the subsequent release. I hope the sample Arun provided earlier provides some sort of an interim solution. Please bear with us for the time being. Thanks, Prakash Surendra Syncfusion, Inc


MI MikeS January 27, 2005 04:22 PM UTC

I should mention that this is a CRITICAL (go/no go) issue for us (we assumed that it already did!) I''ve tried running your example, but am getting licensing error message: Could not transform licenses ile ''licenses.licx'' into a binary resource. (1) : error LC0003 : Unabled to resolve type ''Syncfusion.Windows.Forms.Diagram.Controls.Diagram, Syncfusion.Diagram, Version=2.0.5.1, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89'' This makes it difficult to determine if the suggested workaround is satisfactory.


AD Administrator Syncfusion Team January 28, 2005 06:55 PM UTC

Hi Mike, The error that you noticed is a result of the sample containing a licensing file that was generated when linking to an older version of Essential Diagram. Assuming that you have the latest Essential Suite evaluation version installed on your system, you can safely delete the licensing file from the sample project by opening it in VS.NET, selecting the ''Show All Files'' option from the VS.NET Solution Explorer window and deleting the ''licenses.licx'' file. The sample should now build without any problems. Another option would be to regenerate the licensing information by opening the sample''s MainForm in the VS.NET designer and making some minor change to the form and resaving it. Please note that if you are running the latest 3.0.1.X version of the Essential Suite eval, then you will also have to update the Syncfusion assembly references for the project. Using the ''Add Reference'' dialog, navigate to the ''..Essential Suite\Assemblies\'' folder and select the Syncfusion.Shared.Base, Syncfusion.Shared.Windows, Syncfusion.Diagram.Base and Syncfusion.Diagram.Windows assemblies. These assemblies should replace the existing references to ''Syncfusion.Shared'' and ''Syncfusion.Diagram''. I will post an updated version of the sample as well. Regards, Prakash Surendra, Syncfusion, Inc


AD Administrator Syncfusion Team January 28, 2005 07:02 PM UTC

Attached is a version of the sample that uses the Essential Suite 3.0 assembly structure. Prakash Syncfusion, Inc ControlSymbol_2839.zip


MI MikeS April 6, 2005 01:28 PM UTC

What''s the status of adding this functionality please?


AD Administrator Syncfusion Team April 6, 2005 03:16 PM UTC

Hi Mike, The next update of Essential Diagram, v 3.2, is due out later today, and this build includes a preliminary version of a ''Syncfusion.Windows.Forms.Diagram.ControlNode'' node type that will let you host Windows Forms controls on a diagram. While the ControlNode class itself is fully functional and can be used in your applications, the interactive ControlNodeTool featured in this build still remains to be fully implemented. Hence for the time being you will be able to create and add ControlNodes only through the programmatic API. The ControlNodeTool functionality will be updated in a forthcoming minor update of the product. Regards, Prakash Surendra Syncfusion Inc.,


MI MikeS April 8, 2005 02:51 PM UTC

What''s the best way to stay abreast of this particular feature, as it represents a boolean decision about our use of the product, specifically the full implementation you mentioned?


AD Administrator Syncfusion Team April 8, 2005 09:36 PM UTC

Mike, The new 3.2 version of Essential Diagram features the full implementation for the new ControlNode class that enables hosting Windows Forms controls on a diagram. The class is fully documented in this release, and can be used in your applications. It is only the user interface tool that facilitates the interactive creation of this node type that still remains to be included in the product. Since user interface tools can be added/removed at anytime from within your application, I will provide you with the ''ControlNodeTool'' class as soon as the implementation is complete, and you can directly use it. I will update this incident with the tool and a sample demonstrating the new ControlNode class within a day or two. Thanks, Prakash Syncfusion Inc.,


AD Administrator Syncfusion Team April 13, 2005 02:02 PM UTC

Prakash, have got the version 3.2 installed. The only reason I upgraded was to get diagram control hosting functionality. I very much want to use this product, but I am on deadlines here, and really could use that sample on controlnode hosting you promised in a day or 2 on the 8th! thanks, Steve


AD Administrator Syncfusion Team April 15, 2005 02:25 PM UTC

Hi Steve, I am sorry about the delay in furnishing the sample. But the good news is that we were able to fully wrap up the control hosting implementation, and have integrated the feature into the release version of Essential Diagram 3.2. This final version of Essential Studio 3.2 is due to ship very shortly(later today or early next week), and will feature a ''ControlsGalore'' sample that demonstrates all aspects of the ControlNode and ControlNodeTool classes. Regards, Prakash Surendra Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon